Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

PHP and Apache in Leopard

Can anyone point me in the right direction to get information on upgrading to Leopard and the effects it might have on my current "Personal Web Sharing" setup in Tiger?

I am trying to figure out if I should do an archive and install, or a clean install and then move my existing php pages and mysql databases over...

Just want to make sure I have a happy upgrade experience.

Dual 2GHz G5

Posted on Oct 20, 2007 10:26 PM

Reply
56 replies

Nov 7, 2007 1:51 PM in response to mickey79

@Mickey79:

I had this exact same problem. I ended up going with MAMP after experimenting with a bunch of solutions. Until the Entropy package is ready (Marc is very busy with a paying gig at the moment, so it will probably be a while), this is your best bet if you need GD, MCrypt, etc.

Here's a step-by-step guide to installing MAMP and tweaking for web development use:

http://stringfoo.com/2007/11/07/mamp-setup-leopard/

Cheers,
Steve

Nov 7, 2007 4:21 PM in response to Steve Stinger

Thanks. That is what I thought. But here is what happened...
I inadvertently deleted the original httpd.conf that shipped with 10.5 in etc/apache2. So i copied the one pasted earlier in this thread by eddy kestemont . I was confused when I first saw that post bc it looked like the comments were not all hashed out. So now, I am still not sure how that posting of the httpd.conf file for apache 2 can work.

jeff

Nov 8, 2007 1:22 PM in response to Steve Stinger

Ok, PHP working fine now. Thanks.
Now, need to tackle mysql...
Can't connect to mysql engine.
I followed instructions for mysql on StringFoo. However, if I type mysql or mysqld at the terminal prompt, I get: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)

My phpinfo shows...
PHP version 5.2.4
Configuration File (php.ini) path: /etc
Loaded Configuration File: /private/etc/php.ini

Is this correct?
Why is the path different from the Loaded?

P.S. MySQL has been running on this machine (iBook G4) for nearly 3 years. (Not that it helps much with 10.5 now)...

Also, where are my old databases from mysql 4?

Jeff
-------

Nov 8, 2007 4:21 PM in response to Ndna Jnz

The error you're getting means that MySQL isn't finding the socket that gets created.

One difference between 10.4 and 10.5--or more specifically, the versions of PHP that are installed with each--is that they expect MySQL to be in different places. Since MySQL is still installing in the "old" place, the 10.5 version of PHP can't find it. Thus, we have to give it a little help. To do this, try the following:

Create a text file and save it as "/etc/my.cnf". If you're in a terminal, type:

sudo nano /etc/my.cnf

Enter the following text:

[client]
socket = /var/mysql/mysql.sock
[mysqld]
socket = /var/mysql/mysql.sock

Save the file.

In a terminal window, type the following in order to create a folder where the MySQL sock file will live:

sudo mkdir /var/mysql
sudo chown _mysql /var/mysql

Note: If you are using any of the MySQL Tools (e.g. MySQL Administrator, etc.), you’ll need to tell them where to find the new sock file. To do this, click the Advanced drop-down on the connection dialog, and enter “/var/mysql/mysql.sock“.

Let me know if that helps or doesn't work.

Cheers,
Steve

Dec 20, 2007 3:36 AM in response to Brooks Bennett

I am trying to get php to run, but I am having some problems. I found a site detailing how to switch on php but after following the instructions it still wasn't working. I noticed however that some the files/folders were missing from my private folder that I probably need. Although the machine is new and had Leopard on it from the start, I believe the problem may have arisen when I reinstalled Leopard to resolve another unrelated problem. I noticed that at least one folder that I may need is not in the current private/etc folder. This folder is entitled 'httpd' and it, itself contains a folder 'users'. I believe I need these.

The problem I am having is that the php files are simply showing up as text, I guess they are not being read or parsed properly.

If someone could help and let me know what I need to do to get this to work, ie. Do I need to transfer the httpd folder? If so, how?

Thanks in advance for any help.

PHP and Apache in Leopard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.