Mysql connection problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
joe28778
Forum Newbie
Posts: 4
Joined: Thu Aug 10, 2006 5:34 am

Mysql connection problem

Post by joe28778 »

hi,
i'm migrating from easyphp to use PHP/MySQL and Apache as different units. i have install everything and the are all working fine. the problem occurs when i'm trying to connect to MySql from PHP as i used to do with easyPHP it gives me a fatal error " Class 'mysqli' not found in". i even tried the "mysql_connection()" but still does found that function. i'm stuck here.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

which version of php do you use?

Code: Select all

<?php echo phpversion(), ' : ', php_sapi_name(); ?>
joe28778
Forum Newbie
Posts: 4
Joined: Thu Aug 10, 2006 5:34 am

Mysql connection problem

Post by joe28778 »

thanks for your reply. i'm using:
php 5.1.4
apache2handler
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

If it is a unix/linux/similar system check your distribution wether there is an extra package for mysql/mysqli.
If it is a win32 system check wether you have a directory called ext in your php directory.

Then run the script <?php phpinfo(); ?> and see which php.ini is used.
Open this file with a texteditor.
Search for the line ;extension=php_mysqli. (followed by so or dll)
remove the semicolon and save the file
restart your apache webserver.

An error about libmysql.dll might occur.
If so: windows needs to find this dll for the process that runs php. Therefore the dll has to be in one of some specific locations.
If you have mysql installed on the same win32 system, search for libmysql.dll in the mysql directory and copy it to the apache\bin directory (httpd.exe should be there as well). Then restart the apache again.
joe28778
Forum Newbie
Posts: 4
Joined: Thu Aug 10, 2006 5:34 am

thanks

Post by joe28778 »

thanks very much for your help, it's working now
joe28778
Forum Newbie
Posts: 4
Joined: Thu Aug 10, 2006 5:34 am

Re: thanks

Post by joe28778 »

everything is working fine now nut i now experiencing problem with classes. every class that i include in my code opens as text code instead of exetutable code. i ran the same classes using Easyphp and they worked but after migrating none of them is working. i need some help
Post Reply