Page 1 of 2
Trying to setup PHP on apache keep getting errors....
Posted: Sun Apr 30, 2006 3:44 pm
by user51564
Server Version: Apache/2.0.55 (Win32) DAV/2 mod_gzip/2.1.0 mod_ssl/2.0.47 OpenSSL/0.9.7b PHP/5.1.2
most scripts won't run ... get errors like this ... :
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache
Group\Apache2\htdocs\dk\lib.php on line 55
Notice: Undefined index: style in C:\Program Files\Apache Group\Apache2\htdocs\dice\dice.php
on line 3
Notice: Undefined index: dice in C:\Program Files\Apache Group\Apache2\htdocs\dice\dice.php
on line 4
Warning: getimagesize(styles/style/1.png) [function.getimagesize]: failed to open stream: No
such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\dice\dice.php on line
8
Fatal error: Call to undefined function ImageCreate() in C:\Program Files\Apache
Group\Apache2\htdocs\dice\dice.php on line 14
don't have ssl setup yet can't get apache to find a good server.crt...please help!!!
Posted: Sun Apr 30, 2006 3:54 pm
by feyd
PHP 5 doesn't have MySQL built-in. You'll need to uncomment the line for it in the extensions list, same goes for GD.
I don't understand what i need to do....
Posted: Sun Apr 30, 2006 5:26 pm
by user51564
I'm a newbee at php...i've got perl down but i am just learning mysql and php... please explain in detail for me what to do...i can't figure it out any further...thanks
Posted: Sun Apr 30, 2006 6:18 pm
by John Cartwright
in your php.ini, you'll notice there is a list of extensions that will be loaded.
Some of them have a # before their name, which means they are commented and will not be loaded.
You will find both the mysql and gd extensions are commented out.
Once you have done this, save, and restart apache.
Posted: Sun Apr 30, 2006 7:56 pm
by RobertGonzalez
In my php.ini file the extensions are commented using semicolons ( ; ). You can usually uncomment the line of the extension that you want to use by removing the semicolon in front of it...
Code: Select all
;remove the semicolon from behind the following line
;extension=php_mysql.dll
; Or, for linux machines it might be a .so
;extension=mysql.so
Posted: Mon May 01, 2006 2:02 am
by Oren
(assuming your OS is Win)
After doing what the guys here suggested you, make a phpinfo file and view it with your broswer and check for "Configuration File (php.ini) Path". If it set to something like 'C:\WINDOWS\' then that's not good and you'll need to put the php.ini file in your windows directory and then restart Apache. After that, go to the phpinfo file again and you should see 'C:\WINDOWS\php.ini'. Now all you've got to do is to put the file 'libmysql.dll' in your system directory - that would be 'system32' if you run Win xp or 'system' if you run Win 98.
still have one error left....
Posted: Mon May 01, 2006 7:07 am
by user51564
i did all you guys said to do and i still have one more error with mysql....:
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\chess\createtables.php on line 7
Posted: Mon May 01, 2006 8:18 am
by RobertGonzalez
Post your php.ini file. Specifically the section on the extensions. What OS are you on?
Posted: Mon May 01, 2006 8:19 am
by feyd
Everah wrote:Post your php.ini file. Specifically the section on the extensions. What OS are you on?
The posted error would say Windows.

Posted: Mon May 01, 2006 8:31 am
by RobertGonzalez

Hah! Oh baby, I am amused at my inability to read a freakin' post sometimes. Sorry about that. C:... I try not to see colons, it just sounds nasty....
Anyway, to OP, do have the php_mysql.dll file in your c:\PHP\ext\ folder? Make sure that is there, make sure the line that loads the module is uncommented (and make sure you are uncommenting the mysql line, not the mysqli line), restart apache then run your test script.
Posted: Mon May 01, 2006 8:34 am
by RobertGonzalez
Another thing you should do, too, is check which extensions are loaded in your PHP install. This might shed a little more light on the situation. Try running a print_r(
get_loaded_extensions)) and see what tells you.
This is what i got...
Posted: Mon May 01, 2006 9:19 am
by user51564
Array ( [0] => bcmath [1] => calendar [2] => com_dotnet [3] => ctype [4] => date [5] => ftp [6] => iconv [7] => odbc [8] => pcre [9] => Reflection [10] => session [11] => libxml [12] => standard [13] => tokenizer [14] => zlib [15] => SimpleXML [16] => dom [17] => SPL [18] => wddx [19] => xml [20] => xmlreader [21] => xmlwriter [22] => apache2handler )
looks like its not loading mysql...why?
Posted: Mon May 01, 2006 10:13 am
by RobertGonzalez
I found this
function for loading extensions at runtime in the PHP manual.
Code: Select all
<?php
// Example loading an extension based on OS
if (!extension_loaded('sqlite')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_sqlite.dll');
} else {
dl('sqlite.so');
}
}
// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (!extension_loaded('sqlite')) {
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
}
?>
Maybe try this for the 'mysql' extension. Also, did you make sure that you have the php_mysql.dll in your C:\php\ext folder?
ok...something is wrong with php.ini
Posted: Mon May 01, 2006 10:38 am
by user51564
it's not loading any of the ext i select...i think it is useing another php.ini than the one i'm editing...maybe something in the apache conf...idon't know...please help...
Posted: Mon May 01, 2006 10:49 am
by php3ch0
after installing on my machine php.ini is in C:/windows