Any uggestions for getting php5 on the iMac-Intel?

Posted:
in Genius Bar edited January 2014
Hello,



I just recieved my 17"-iMac-Intel.



NICE, QUIET machine ... very nice ... BUT, I can't seem find a way to get php5 installed properly ...



I normally use eithe the package intallers from Entropy or ServerLogistics, but niether seems to work properly on the new Intel based Macs ...



Can anyone offer any support?



FYI - I have gotten Eclipse 3.1.x and MySql 5.0.x running ... see details here: http://discussions.apple.com/thread....35184&tstart=0



Also, yes I am aware that PHP 4.3 ships with the machine and how to enable it ... I realy need php5 ... ;-)



Thanks in advance!



Brad

Comments

  • Reply 1 of 1
    Ok, well in answer to my own question the following is simple for the record ... YES PHP5.1.1 will comile from source on the new Intel Macs ... I am running the stock Apache 1.3 and MySql 5.0.18 ... see above for MySql Details ...



    NOTE: This failed for the newest PHP 5.1.2, during the final compile ... :-(



    If you need to do this and have never installed from source, like I had not ... its not that bad, just follow along ...



    --First things first, we need a compiler--

    0. Take the Mac OS X CD: Disk 1 that came with your shinny new MacIntel and install Xcode ... yeah just intall everything ... now you have a compiler ... see no fuss!



    -- We need to get the php5 source and move it to a good location on the computer --

    1. Download the PHP 5.1.1 Source from http://www.php.net

    2. Untar/zip ... the file until you have a folder to work with ...

    3. Rename the folder "php5" ... yes make it lowercase ...

    4. Open the terminal ... don't freak out this is pretty easy too, just type what I say and you'll be OK ... [The terminal in under the Applications>Utilities folder]

    5. In the terminal you should see something like this:

    brads-computer:~ brad$ <-- Just with your name and stuff ... ok?

    6. Enter the following then hit enter: cd Desktop

    7. Enter the following then hit enter: sudo cp -r php5 /usr/local/php5

    It will ask for a password, type in YOUR login password, it won't display, hit enter

    8. Enter the following then hit enter: cd /usr/local/php5

    9. Enter the following then hit enter: ls

    You should see a whole slew of php5 files that you probably don't recognize ... it's alright.



    -- You are now going to build from source --

    10. Enter the following then hit enter: ./configure --with-mysql=/usr/local/mysql --with-xml --with-apxs

    ***You're values may be different if you want to configure more options or have mysql installed in a different location

    ***Go get some water or coffee, this will take a few minutes

    11. When it's finished, Enter the following then hit enter: sudo make

    ***Another pause, go see see your wife or girlfriend [Change statement genders if you're a female], let them know the MacIntel is REALLY not the most important thing in your life

    12.When it's finished, Enter the following then hit enter: sudo make install



    --You're almost there, time to configure the Apache web server --

    13. Enter the following then hit enter: cd ~/Desktop

    14. Enter the following then hit enter: sudo cp /etc/httpd/httpd.conf /etc/httpd.conf.bkp

    Yes you just made a backup of something important ... ;-)

    15. Enter the following then hit enter: sudo cp /etc/httpd/httpd.conf ./httpd.conf

    This will put a copy of the httpd.conf file on your desktop for easy access

    16. Minimize the Terminal window, and open the httpd.conf file withyour favorite text editor ... I like SubEathaEdit or Eclipse ... just make sure it will save out to plain text

    17. In the httpd.conf file search for "php" ... change the following lines:

    A. OLD = #LoadModule php4_module libexec/httpd/libphp4.so

    NEW = LoadModule php5_module libexec/httpd/libphp5.so

    B. OLD = #AddModule mod_php4.c

    NEW = AddModule mod_php5.c

    C. OLD = <IfModule mod_php4.c>

    NEW = <IfModule mod_php5.c>

    18. Save the file, and go back to the terminal window ... it should still be referencing your ~/Desktop

    19. Enter the following then hit enter: sudo cp ./httpd.conf /etc/httpd/httpd.conf

    20. Open the System Preferences>Sharing pane and turn the "Personal Web Sharing" = On

    If this was already "On", turn it off, then "On" again ... forcing our new httpd.config file to be read and loaded ...



    -- You did it --

    You now have PHP5 installed on you MacIntel!



    I won't get into testing here ... see http://www.php.net ... documentation ... for all that.



    I hope this helps someone else ... I'm headed to bed!



    Brad
Sign In or Register to comment.