A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearPHP, MySQL on IIS - MySQL not being loaded when serving pages - page 1
User InfoPosts
PHP, MySQL on IIS - MySQL not being loaded when serving pages#1
I have, as best as I can manage, set up IIS (6.0), PHP (5.2.8) and MySQL (5.1.30) on Windows Server 2003, with all the involved mucking about (I think) in IIS and PHP to get things talking to each other.

PHP does work - however, I cannot use the mysql or mysqli libraries from a PHP page.
Fatal error: Class 'mysqli' not found in...
Fatal error: Call to undefined function mysql_connect() in...

Information relating to MySQL or MySQLi does not appear when using phpinfo() in a PHP page.

However, when I invoke PHP from the command line, such as

> php -r phpinfo()


Information relating to MySQL and MySQLi does appear in the output from that.

Restarting IIS or the OS does not produce further effect. I have only one php.ini file, in the PHP root directory.

Do I need to connect MySQL to IIS somehow as well, or is there another problem?

posted date: 2008-12-11 17:21:00


Re: PHP, MySQL on IIS - MySQL not being loaded when serving pages#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-11 17:21:01


Re: PHP, MySQL on IIS - MySQL not being loaded when serving pages#3
The php.ini file used for command-line usage of PHP may be different from the php.ini used by the web server. You should get phpinfo() information by putting a small PHP script under your web server's document space:<?phpphpinfo();?>Open this PHP script by using your browser to request that PHP script via an URL to your web server. That will tell you what the web server thinks is your PHP configuration.Also remember that you need to restart the web server for edits to php.ini to take effect. It only reads the php.ini when the web server starts.There are numerous places the php.ini file that your IIS instance is using might live. See http://php.net/manual/en/configuration.php or http://www.iis-aid.com/articles/how_to_guides/where_php_ini_is_loaded_from for details.Look at the output of phpinfo() when viewed in your browser, and look for the item "Loaded Configuration File".

posted date: 2008-12-11 17:24:00


Re: PHP, MySQL on IIS - MySQL not being loaded when serving pages#4
Yes, I have been restarting the server regularly. The problem is, using phpinfo() as above returns different results than on the command line - and so MySQL works from the PHP command line but not from web pages. I have only one php.ini file, in the PHP root directory.

posted date: 2008-12-11 17:49:00


Re: PHP, MySQL on IIS - MySQL not being loaded when serving pages#5
Yep, checking the location of the ini file did it - turns out it wasn't finding it. I put a copy in C:\Windows, and it worked :)

posted date: 2008-12-11 19:49:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.