Setting up Apache, PHP, MySQL under Vista
Update 7-22-07:
For some reason, and I’m not sure why, I wasn’t able to get MySQL to work with PHP. PhP was working, and MySQL was working from the command prompt, but php was not loading the the mysql dll, or not loading it properly. I tried many different scenarios to get it work and finally gave up. I uninstalled Apache, PhP and MySQL and downloaded WAMP5 (www.wampserver.com). WAMP is an installer that installs Apache, MySQL and PHP so that they all work together right from the start. After spending 3 days trying to Install those on my own, I used WAMP and was up and running in 15 minutes. Once installed you can make changes to the httpd.conf, php.ini and mysql as you normally would to customize it for yourself. However, you may still need to disable UAC, but I’m not sure about this.
If you would still like to manually install php/mysql/apache on vista then check out the post below which got php and apache running just fine. If you get MySQL to work with PhP on Vista, I would love to hear how you did it!
Disable User Account Control (UAC) and never look back!
As I mentioned in my last post, I now have Vista Home (for good or bad, it came with my new laptop). First thing I must say is if you have a working system on XP, unless you have a specific NEED to upgrade to Microsoft Vista, then Don’t. It has been a troublesome experience for me and now that I have everything working pretty well, there are still little unexplained annoyances (i.e., explorer.exe crashes about once every day or two for no apparent reason, though it does start right back up in about 30 seconds and doesn’t effect my other open programs).
That being said, if you do have Vista and are installing (or planning to install) a web server (especially the Apache/PhP/MySQL variety) than the first thing you should do to eliminate at least half of your head-aches is to disable User Account Control. There are many different ways of turning this off and you can find them described here:
http://www.petri.co.il/disable_uac_in_windows_vista.htm
Once you have done this, you should have no problem installing Apache the way you are familiar with (I’m not going to get into that here). Now you are ready to install php.
Install PhP under Apache and Vista:
If you have disabled User Account Control and have successfully installed Appache then check out the step-by-step instructions here:
http://senese.wordpress.com/2007/06/06/install-php-5-under-apache-22-and-windows-vista/
I follwed that procedure from start to finish (after removing my innitial php install attempt) and was up and running with no problems.
I am now working on installing MySQL and if anything weird should come up, I’ll add it to this post.
~Billy Flaherty
Website Developer
www.billyswebdesign.com
Hey Billy,
Thanks for the great blog! I read your question posted on: http://senese.wordpress.com/2007/06/06/install-php-5-under-apache-22-and-windows-
…about the strange
Hm. Not sure if my last post came through properly (above). What I was saying was I also got the “Fatal error: Call to undefined function mysqli_connect() ” and am trying to figure out why. Any ideas?
KiwiBurdy,
Hi, Have you looked in your php.ini file to make sure that the “;extension=php_mysqli.dll” line has had the semi-colon removed to enable the library? so it should read:
extension=php_mysqli.dll
notice this is a separate line from:
extension=php_mysql.dll
I have both of these lines enabled (semi-colon) removed in my php.ini so my mysql and mysqli functions work just fine in my php scripts.
I tried to install php on Windows Vista with PHP installer, but it gave me an error after a few seconds..I then realized that I can’t use the PHP installer with Vista after some small researches.I opened my control panel>programs and features and PHP was there.I tried to uninstall it,but it gave me an error…
Could this cause any problems if I now try to install PHP manually?
Thanks guys…
Having just set up Apache/2.2.9, PHP/5.2.6, and mySQL 5.0.51b the only oddity from what I’m accustomed to having to do in relation to getting the mySQL module to load was to use an absolute path for ‘extension_dir’ instead of the typical ‘./ext’.
Also, I don’t have UAC disabled and didn’t run into anything unexpected.
I had the same “Fatal error: Call to undefined function mysql_connect()” message, with the Apache error “PHP Startup: Unable to load dynamic library ‘C:\Program Files\PHP\ext\php_mysql.dll’ - The specified module could not be found.” in the Apache error log. I found that if I switched the backslashes to forward slashes in the PHP.ini file, Apache was able to find the module, and everything worked from there on out.
i.e. Change the line:
extension_dir =”C:\\Program Files\\PHP\\ext”
to:
extension_dir =”C:/Program Files/PHP/ext”
php_mysql.dll and php_mysqli.dll both have problems with the backslashes in the extension_dir line of php.ini.
Other modules load fine with them, which made this a really tricky problem to diagnose. Swap it to forward slashes and problem solved.
I have a REALLY weir problem…
Under Windows Vista Home Premium, SP!, I am using Abyss X1 as Webserver with PHP5 over FastCGI…
Problem is…
UAC Activated: Abyss+PHP+MySQL works fine!
UAC Deactivated: PHP doesn’t respond!
It’s very weird, and maybe it’s because I downloaded the zipped binaries of php but not the installer…