Apache Version in Leopard?

Discussion in 'macOS' started by lolajl, Oct 26, 2007.

  1. lolajl macrumors newbie

    Joined:
    Jul 24, 2002
    #1
    What's the version of the Apache Server in Leopard? Is PHP included, and if so, what version?
     
  2. mwdmeyer macrumors member

    Joined:
    Dec 23, 2004
    Location:
    Sydney, Australia
    #2
    Apache/2.2.6 and PHP 5.2.4 which is awesome.

    PHP isn't enabled by default but all you need to do is uncomment a few lines in the httpd.conf.
     
  3. gujamin macrumors member

    Joined:
    Aug 6, 2002
    Location:
    Atlanta
    #3
    which lines?

    Which lines? All I saw were comments for PHP4
     
  4. mwdmeyer macrumors member

    Joined:
    Dec 23, 2004
    Location:
    Sydney, Australia
    #4
    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).
     
  5. chrisS macrumors member

    Joined:
    Sep 21, 2007
    #5
    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 ?
     
  6. gujamin macrumors member

    Joined:
    Aug 6, 2002
    Location:
    Atlanta
    #6
    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)
     
  7. /dev/toaster macrumors 68020

    /dev/toaster

    Joined:
    Feb 23, 2006
    Location:
    San Francisco, CA
  8. gujamin macrumors member

    Joined:
    Aug 6, 2002
    Location:
    Atlanta
    #8
    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.
     
  9. ValGor macrumors newbie

    Joined:
    Feb 20, 2005
    #9
    Pdo_mysql

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

    Joined:
    Oct 29, 2007
    #10
    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.
     
  11. jaffle macrumors newbie

    Joined:
    Oct 24, 2008
    #11
    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.
     

Share This Page