On Thu, 23 Mar 2006, Jahislove wrote:

> To: php-install@lists.php.net
> From: Jahislove <[EMAIL PROTECTED]>
> Subject: Re: [PHP-INSTALL] can't access mysql from a php script
> 
> [EMAIL PROTECTED] a écrit :
> > OK, forget the last mail - lets start again.
> > 
> > Does the output from phpinfo() say you have the mysql module loaded?
> 
> No there is nothing about mysql in my phpinfo()

Look at the following setting, about the 6th entry down in 
phpinfo output:

Configuration File (php.ini) Path 
/usr/local/php-5.1.2/lib/php.ini 

That tells you where your current installation of php will 
look for it's configuration file, php.ini.

Make sure that your php.ini is in the correct location for 
your installation of php. You may need to copy php.ini or 
move it from another location to the one where your php 
looks for it.

There are two settings you will need to alter in php.ini to 
load the mysql extension - assuming that the mysql 
extension exists on your sysyem.

If you are not sure where mysql.so is on your system, you 
could use something like mc (Midnight Commander) to do a 
search with:

F9->C->F (Function Key F9->Command->Find File)

Start at: /

Filename: mysql.so

Content: (leave empty)

[ ] case Sensitive

Then hit OK.

Hopefully, this will tell you where mysql.so is on your 
system. If it does not show up, you may have to go into your 
Linux distro's setup program, and install the mysql.so php 
extension if it is available there.

Set the following directive to point to the directory where 
your php extensions are.

; Directory in which the loadable extensions (modules) reside.
;extension_dir = ./
extension_dir = /usr/local/php-5.1.2/lib/php/extensions/

Further down in php.ini you you need to tell php to look in 
the above directory, and load the mysql.so extension with:

;extension=mime_magic.so
extension=mysql.so
;extension=ncurses.so

Don't forget to restart Apache server to make any changes to 
php.ini come into effect. The apache php module only reads 
php.ini at server startup time.

There should be a section for the mysql module appear in 
phpinfo output, when the mysql module has loaded.

Hopefully, this will help you to get the mysql.so module 
loaded into php.

Regards

Keith

Reply via email to