Re: Fatal error: Call to undefined function mysql_connect()
Posted by:
KK Z
Date: September 03, 2007 02:00AM
Starting straightforwardly, I'm unable to use MySQL with PHP & Apache despite trying various permutations of libmysql.dll, php_mysql.dll, php.ini, my.ini, old_password(), etc. on Windows XP/98_SE for the past fortnight. Somebody pleez help me out.
----------------------------------------------------------------------------------
Part I
----------------------------------------------------------------------------------
On Windows 98 SE II, I tried with (Apache 2.0.55 + PHP 5.2.0 + MySQL 5.0.15). All are installed at their default locations i.e. C:\Program Files. Apache & PHP are working perfectly fine but after a lof of R&D I could overcome the problems of having to start MySQL with "mysqld --standalone" command everytime. It has got something to do with the compilation errors during installation in default folders. I saw the help of 'comp-err.exe' in 'C:\Program Files\MySQL\MySQL Server 5.0\bin' which gives the path as '../sql/share/'. So I created a batch file "ce.bat" as :
COMP-ERR --charset="\Progra~1\MySQL\MYSQLS~1.0\share\charsets" --in_file="\Progra~1\MySQL\MYSQLS~1.0\share\errmsg.txt" out_dir="\Progra~1\MySQL\MYSQLS~1.0\share" --out_file="\Progra~1\MySQL\MYSQLS~1.0\share\english\errmsg.sys" --header_file="\Progra~1\MySQL\MYSQLS~1.0\include" --name_file="\Progra~1\MySQL\MYSQLS~1.0\include"
which created 'sql_state.h' in "C:\Program Files\MySQL\MySQL Server 5.0\bin" folder. I copied the same into the "C:\Program Files\MySQL\MySQL Server 5.0\include" folder.
Further, I created a batch file named "mysqld_k.bat" as :
mysqld --basedir="\Progra~1\MySQL\MySQLS~1.0" --datadir="\Progra~1\MySQL\MySQLS~1.0\data" --character-sets-dir="\Progra~1\MySQL\MySQLS~1.0\share\charsets" --language="\Progra~1\MySQL\MySQLS~1.0\share\english" --pid-file="\Progra~1\MySQL\MySQLS~1.0\data\aks.pid" --console
where "aks.pid" is file created during installation of MySQL in the "data" folder of MySQL. After this MySQL was started perfectly on its designated port.
But even after this MySQL could not be integrated with PHP & Apache. As a last resort I even copied "libMySQL.dll" into Apache's "bin" folder.
[Note :- Creation of batch files is essential as MS-DOS buffer will not accept such a long command from Command Prompt. Also one can change settings for DOSKEY command.]
----------------------------------------------------------------------------------
Part II
----------------------------------------------------------------------------------
On Windows XP SP1a (+SP2 applied), I'm using (Apache 2.2.4 + PHP 5.2.3 + MySQL 5.0.45). All the packages are installed in their default folders i.e. "C:\Program Files". Again MySQL is not being recognised in PHP though it's running perfectly on the system on its designated port.
Kindly spare some time & help me out please.
Thanking you in advance,
KKZ