PDA

View Full Version : The mysql and php4 connection bug in the php.ini



WaKa
03-18-2007, 06:36 PM
This will make you apply HeadOn to your forehead.
When making a connection with mysql and php4 one of the configurations is to uncomment
the extension in the php4.ini file.
However, the php extension has a typo in this file.
/etc/php4/apache2/php.ini
Under the Dynamic Extensions section it reads:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
;
; Example lines:
;
;extension=mysql.so
;extension=gd.so
The first extension for UNIX reads:
; extension=msql.so
It should read
; extension=mysql.so [ It's missing a y ]
The second one is ok
;extension=mysql.so

Either uncomment the second one or correct and uncomment the first for mysql connection to php.
So far I've found this typo also in other Knoppix versions and other php.ini's.
The Windows geekers ironically have it worse they have to deal with msql.
note: Don't make any white space between the equals sign. Also PHP code has something similar too.
The other config is to uncomment the 'extension_dir ='
then add '/usr/lib/php4/extensions'
Save and exit and make a extensions directory
# mkdir /usr/lib/php4/extensions
locate mysql.so then copy the path of mysql.so to /usr/lib/php4/extensions/
restart apache2
# apache2 -k restart or apache2ctl restart
# /etc/init.d/mysql start
<Enter>
# mysql -u root

---
Addendum:
The extension msql.so is from mini SQL(mSQL).
However, use mysql.so and MySQL

---
Addendum2:
Since Oracle is gobbling up things and CD versions after 501 don't have Mysql-server it might be wise to download it and save it somewhere.