Apache Version in Leopard?

lolajl

macrumors newbie
Original poster
Jul 24, 2002
10
0
What's the version of the Apache Server in Leopard? Is PHP included, and if so, what version?
 

mwdmeyer

macrumors member
Dec 23, 2004
35
0
Sydney, Australia
To enable php

1) open terminal
2) cd /etc/
3) sudo cp php.ini.default php.ini
4) cd /private/etc/apache2/
5) sudo nano httpd.config
6) uncomment the two modules: php5_module and fastcgi_module. They were at line 114 and 115 for me.
7) Use ctrl and o to save
8) reload apache (can be done from system preferences).
 
Comment

chrisS

macrumors member
Sep 21, 2007
31
0
Strange ... php.ini location

I installed Leopard at work and at home. The php.ini locations are different. Is there any way to have PHP use a different location for the php.ini file ?
 
Comment

gujamin

macrumors member
Aug 6, 2002
66
0
Atlanta
To enable php

1) open terminal
2) cd /etc/
3) sudo cp php.ini.default php.ini
4) cd /private/etc/apache2/
5) sudo nano httpd.config
6) uncomment the two modules: php5_module and fastcgi_module. They were at line 114 and 115 for me.
7) Use ctrl and o to save
8) reload apache (can be done from system preferences).
Awesome! That worked great! So, how do I get MySQL working?:
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
 
Comment

gujamin

macrumors member
Aug 6, 2002
66
0
Atlanta
Awesome! That worked great! So, how do I get MySQL working?:
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
Found the answer on another forum. For anyone else having trouble, here's the solution:

you need to do the following in terminal.app when safe_mysql is running.

sudo mkdir /var/mysql/

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Then restart apache.
 
Comment

ValGor

macrumors newbie
Feb 20, 2005
25
0
Pdo_mysql

Please help. How do i turn pdo-mysql on for Leopard's native 5.2.4 php?
Thanks in advance,
V.
 
Comment

eavary

macrumors newbie
Oct 29, 2007
1
0
Found the answer on another forum. For anyone else having trouble, here's the solution:

you need to do the following in terminal.app when safe_mysql is running.

sudo mkdir /var/mysql/

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Then restart apache.
The root issue is that in the php.ini file (as it comes with Leopard) it is never stated where the socket is, therefore the built-in MySQL default is used. While the above solution works, another answer is to open php.ini and edit the configuration for default socket name (around line 760):

mysql.default_socket = /private/tmp/mysql.sock

This ought to do the trick.
 
Comment

jaffle

macrumors newbie
Oct 24, 2008
1
0
Perhaps a cleaner way to fix the mysql.sock problem

We all agree that if you want the supplied version of php in Mac OS X Client to work with the default installation of MySQL (not supplied in Mac OS X Client) you need to change the default setting in php for the mysql.sock file...

A nice way of doing this is to add

Code:
php_value mysql.default_socket /tmp/mysql.sock
to the

/private/etc/apache2/other/php5.conf

file (in between the </IfModule> tags of course). In most cases the php.ini file does not exist, and instead of the complication of creating it and possibly altering it or allowing a security risk, this method even turns off if you disable php5 down the track! It will also cause no problems if Apple update php/MySQL down the track.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.