Post Archive
› January 17, 2006
Start PHP on your new Mac
This is largely just a note to self:
- Be sure bbedit or textmate or some other tool that has command line support is installed first
- Open terminal
- Open the php config file:
bbedit /etc/httpd/httpd.conf(changebbeditif you're using something else) - Search for the term php
- Un-comment the lines you find to contain php (remove the
#at the start of the lines) - Save the file, open the system preferences and restart the web server by turning off/on again Personal Web Sharing under Sharing
Warning: At the time of this writing, this starts up the default version of PHP, which even on brand new Intel iMacs is version 4.3.1. Also, this info might be outdated by the time you read this. Doing this might not work on your computer, your computer might melt, it might train your cat to DESTROY, it might ruin your life's work - use at your own risk. Thanks Dan, for the reminder on how to go about this.
Comments
1. January 17, 2006 11:01 AM
2. January 17, 2006 11:24 AM
Rob Posted…
While we're on the topic, does anyone know a good tutorial on upgrading PHP on the Mac, say to 4.x or 5.x? Thanks.
3. January 17, 2006 11:43 AM
4. January 17, 2006 12:51 PM
tony Posted…
maybe this will help. i used this package to install php 5.
http://www.entropy.ch/software/macosx/php/
5. January 23, 2006 09:20 PM
Jonathan Posted…
Actually pico will work just fine and it's included in the terminal. Also, for a quick fix you might want to look at MAMP or Complete PHP at http://www.serverlogistics.com/php4.php. Server logistics also has a MySQL installer as well.
6. January 24, 2006 09:42 AM
Dave Posted…
Thanks! Been looking for an easy tutorial to get php working since I purchased my new intel iMac. I reckoon this info should be made more widespread as people who know php but don't really know the inner delvings of Mac OS X (such as myself) would really benefit from it.
7. February 1, 2006 03:12 AM
Chad Posted…
A little help please, I have a new Intel iMac, my first mac, though I have used them here and there and know my way around. I installed textmate, opened the terminal and typed textmate /etc/httpd/httpd.conf
it just said command not found. ???
8. February 2, 2006 12:28 AM
9. February 17, 2006 07:48 AM
10. February 21, 2006 11:50 PM
andrew Posted…
Anyone had luck getting this PHP install to work with the x86 MySQL 5 download from their website?
11. March 1, 2006 07:41 PM
12. March 3, 2006 12:52 AM
Joe Posted…
I have an Intel iMac and I think I figured out part of the problem with MySql connections. There is no socket link in /var/mysql. If you are in terminal you should create a directory called "mysql" in the "var" directory. then go to that directory and run the command "ln /tmp/mysql.sock ." That did the trick for me.13. March 4, 2006 07:42 PM
Andrew Montague Posted…
Hi Joe
I followed your directions, but when I ran "ln /tmp/mysql.sock" I got this message: "No such file or directory". Any ideas where I'm going wrong?
Thanks
14. March 5, 2006 07:31 AM
CarbonCopy Posted…
The instructions posted by Joe, above, had a slight error. It should be "ln /tmp/mysql/mysql.sock"
THAT worked for me. Hope that helps.
15. March 6, 2006 07:48 PM
Ryan Martell Posted…
Hey Andrew- A couple of things:
16. April 8, 2006 05:58 AM
glen Finch Posted…
Same problem with socket link in connecting MySQL, creating a link to /tmp/mysql.sock works, but only until the server is restarted. Any ideas anyone?
I also really need to get WDDX and GDLib libraries which don't come with the default PHP installation so I might end up having to compile from scratch afterall. Shell commands are not be speciality so be gentle! Any advice welcome
17. April 19, 2006 11:44 AM
bryan Posted…
I was able to get the socket link between PHP and MySQL working just fine but it broke as soon as I rebooted. To get it working again I had to 'sudo rm /var/mysql/mysql.sock' and then redo the link 'ln /tmp/mysql.sock'
I am going to do some hunting but does anyone know of a way to automate this process on startup?
18. April 20, 2006 11:54 AM
Ravi Posted…
To get mySQL working with php on iMac Intel:
1 - Locate the file /etc/php.ini.default
2 - Make a copy of this file called php.ini
Look for the bit that says:
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
3 - type /tmp/mysql.sock after mysql.default_socket =
4 - Save and restart Apache
That should do it
19. April 27, 2006 09:19 AM
Paula Posted…
Help please? I want to run php on my iMac core duo, but can't get it to fly. I can turn on web sharing so that's okay, but when I un-comment the php lines in terminal I still can't run php. I want to run php5 but right now I'd be happy with 4.
20. April 27, 2006 09:22 AM
Paula Posted…
Shoulda posted here sooner! By some miracle it just started working. I just turned sharing on and off a few times.
Justin Goodlett Posted…
I've tried for almost 2 days now and this little tip did the trick. Couldn't have done it without ya Nate!