Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

scan

macrumors 6502
Original poster
Oct 24, 2005
344
0
I usually am able to solve my own problems using google but I'm desperate to the point where I'm hoping someone can help me on this forum.

Here's the main problem: I'm running OSX 10.4.11. It has php 4.4.9 preinstalled. I'm trying to run PHP 5 and MySQL so I can do some development on my laptop. After countless hours of googling and trying to update my PHP, I can't get my apache to run php 5. It keeps running 4.4.9 even though the binary (/usr/local/bin/php) shows version 5, while (/usr/bin/php) shows version 4. That's the first problem. (Yes, I tried configuring httpd.conf)

Second, I've installed the latest MySQL but I can't connect to it. It's giving me a socket error.

I'm really not a webdeveloper but I have a huge assignment to do and I really need to get these components running. I really don't know what else to do.
 
Honestly, MAMP is the easy way to go. It'll set you up with PHP5 and MySQL without any hassle.

If that's not what you want it would help to see some of your configuration files. Like what you configured in the httpd.conf file.
 
1. I don't have a copy of the OS X 10.4 httpd.conf but try adding a LoadModule statement for the PHP5 .so file you installed.

2. Update your php.ini and change the mysql.default_socket and mysqli.default_socket variables so they are '/tmp/mysql.sock'.
 
Ok oddly enough, I just tried to install everything once again and it worked! So this is great now. I have mysql php 5 running. Only one problem now. I can't get the cgi interpreter to run php scripts. Any ideas?
 
Ok oddly enough, I just tried to install everything once again and it worked! So this is great now. I have mysql php 5 running. Only one problem now. I can't get the cgi interpreter to run php scripts. Any ideas?

Can you show us what you've tried so far?
 
Mamp

Echoing the recommendation to install and develop with MAMP. It's just drop dead easy. Spend your time coding, rather than chasing settings in config and ini files.
 
Ok oddly enough, I just tried to install everything once again and it worked! So this is great now. I have mysql php 5 running. Only one problem now. I can't get the cgi interpreter to run php scripts. Any ideas?

You don't want to run PHP as a CGI, you want it as a shared module (DSO) in Apache - runs so much faster.

In httpd.conf something like this:
Code:
LoadModule php5_module libexec/apache2/libphp5.so
AddType application/x-httpd-php .phtml .php
AddType application/x-httpd-php-source .phps

Assuming Apache 2.2 series was compiled with --enable-mods-shared=most or all, or in any way dynamically compiled as DSO's and the .so file lives there, i.e. libphp5.so was created when PHP5 was compiled. Restart apache after every change to httpd.conf.

If you don't know what any of the above is then you should NOT be modifying your Mac, stop what you're doing and install MAMP - which installs all this for you without need to know the tech stuff, plus it is installed separate from your Mac default setup and you can easily start/stop the daemons via app icons.


-jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.