Topic: php + mysql

alright, i have a web server (Xitami), and i have PHP 5.0.1 installed on it. i also have some version of MySQL installed on it, too lazt to check. i will if its needed.

my problem is that when i try connecting to the database, it returns this errer.

Fatal error: Call to undefined function mysql_connect() in C:\xitami-25\app\ftproot\connect.php on line 2

of cource line 2 is where the connect is located. i looked around, and found in the MySQL manual that PHP must be compiled with MySQL support. ive searched google, and have found nothing yet.

if anyone could point me to a site with a precompiled version, id appreciate it.

Indocron
$theQuestion = (2*b) || !(2*b);

Re: php + mysql

mysql support is compiled with php in the default version

Re: php + mysql

well, ive gotten the default version of PHP, and it doesnt seem to be. i still get the message that MySQL says means that PHP doesnt have mysql support

Indocron
$theQuestion = (2*b) || !(2*b);

Re: php + mysql

You must remove a ; in php.ini to make it work :) Just search for 'mysql' and you'll find the right row.

Re: php + mysql

im sure ive tried this before. i find a bunch of defaults, the port, username, pass, and so on. i also find a list of extensions, that have a bunch of dll's.

;extension=php_msql.dll
;extension=php_oci8.dll

there in alphabetical order, yet i see nothing

Indocron
$theQuestion = (2*b) || !(2*b);

Re: php + mysql

It's in my list:

php.ini wrote:

;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll

Though, it took a while before I got it working. I also had to move some dll's into the windows-directory...

7 (edited by Connorhd 2004-10-22 22:57)

Re: php + mysql

TIP: Do not be confused by the following line in the Extensions section:

;extension=php_mysql.dll

If you want to use MySQL with PHP on Windows, you do not need a file called php_mysql.dll and do not need to uncomment that line. MySQL support is built into the official distribution of PHP4 and no additional files or changes to php.ini are necessary to enable support.

apache + php + mysql just works for me :S

oh your doing php5 maybe its different /me goes to look

Re: php + mysql

got it

php.net wrote:

In PHP 5, MySQL is no longer enabled by default, nor is the MySQL library bundled with PHP. Read this  FAQ for details on why.

    Note: Windows users will need to enable php_mysql.dll inside of php.ini and either copy libmysql.dll into the Windows system directory, or make it available to the PATH.

    This will fix "Unable to load dynamic library './php_mysql.dll'" errors.

Re: php + mysql

its still not working. ive tried moving the libmysql.dll into the windows directory, but i dont know where to get php_mysql.dll, where to put it, or even how to enable it in the php.ini file

Indocron
$theQuestion = (2*b) || !(2*b);

10

Re: php + mysql

make

C:\mysql\bin
C:\PHP

in a PATH environment

If your people come crazy, you will not need to your mind any more.

Re: php + mysql

umm... that means what?

Indocron
$theQuestion = (2*b) || !(2*b);

Re: php + mysql

add this to your php.ini

extension=php_mysql.dll

and copy
libmysql.dll to your windows/system32 folder i think NOT just in your windows folder

Re: php + mysql

ok, any clue where i can get the php_mysql.dll and where to put it?

Indocron
$theQuestion = (2*b) || !(2*b);

Re: php + mysql

you don't need to get it you just need to uncomment it in the ini

its in the ext folder though if you don't have it you can try putting this one in the ext folder i guess http://66.98.138.31/~connorhd/php_mysql.dll

15

Re: php + mysql

i already install php5, i was recorded my steps

delete old "c:\php" if is exist
extract "php-5.0.0-Win32.zip" to "c:\php"
copy "php.ini-recommended" to "c:\windows\php.ini"
open "c:\windows\php.ini"

search for "extension_dir" you find

extension_dir = "./"

change it to

extension_dir = "./ext"

search for "php_mysql.dll"
you will find this lines

;extension=php_mysql.dll


remove the semicolon from the extension like that for mysql

extension=php_mysql.dll

open "Control Panel- System" go to "Advanced" and press button "Environments Variables"
in "System variables" edit "PATH" and add ";c:\php;c:\mysql\bin", OK and close

open "C:\Program Files\Apache Group\Apache2\conf\httpd.conf"

add

LoadModule php5_module C:/PHP/php5apache2.dll
AddType application/x-httpd-php .php .phtml

restart apache server

if you use php localy not for a public site
open php.ini in "c:\windows"
search for key and make it as

error_reporting  =  E_ALL
display_errors = On

add to extensions

extension=php_dbg.dll

add

[Debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.JIT_enabled=on
debugger.JIT_port =7869 
debugger.JIT_host =127 .0.0.1

download dbg-2.11.26-Win32.zip and extract it in c:\php\dbg

copy "c:\php\dbg\server\php_dbg.dll-5.0.0" to "c:\php\ext\php_dbg.dll"

restart apache

run "C:\php\dbg\client\install.bat" once
run "C:\php\dbg\client\DbgListener.exe" when you need to debug
you must have debug client like phpxedit i like it search it on internet

link

If your people come crazy, you will not need to your mind any more.