faqts : Computers : Programming : Languages : PHP : General Information : Supported Platforms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 13 people (100%) answered Yes
Recently 3 of 3 people (100%) answered Yes

Entry

Are there plans for an OSX build of PHP? MySQL is already there....

Nov 22nd, 2008 01:40
Raj Aryan, Vip Malixi, Dominique Peretti, Paul Wieland, Onno Benschop, Scott Anguish, René Voorburg, Matthew Vaughn


Link to Precompiled Packages for MacOS X Public Beta, including 
MySQL, PHP, and Apache...
Installing and Making Apache/PHP/MySQl work together on Mac 
OSX v1
Compiled and partly written by Vip Malixi with contributions from 
Scott Anguish, René Voorburg, Matthew Vaughn
1. Be able to log in as Root:
Steps:
a) Go to the following Folder Applications | Utilities and run 
"NetInfo"
b) Select menu item -> Domain | Security | Authenticate
c) Enter your password
d) Select menu item -> Domain | Security | Enable Root
e) Enter a password for Root (why not use your own password?)
2. Install the Mac OSX Developer CD 
3. Restart into Mac OS9 (unless you can do the following in Mac 
OSX--in my case, I couldn't) and do the following:
3. Download the files (Note, even if the site offers other packages, 
don't get them, for some reason, they didn't work together, and 
these instructions assume only the files I mentioned):
MySQL : MySQL-3.23.28-1.0.pkg.tar.gz  at http://www-
u.life.uiuc.edu/~mwvaugh/MacOSX/Packages/
Apache: apache_1.3.19.tar.gz at http://www.apache.org/dist/httpd/
apache_1.3.19.tar.gz
PHP: php4.0.4.img at http://homepage.mac.com/olav/
FileSharing.html
4. Run Stuffit Expander to unbinhex php4.0.4.img
5. Mount image php4.0.4.img
6. Copy php-4.0.4pl1.tar.gz to your hard disk
7. Have all files accessible for bringing into Mac OSX:
php-4.0.4pl1.tar.gz
apache_1.3.19.tar.gz
MySQL-3.23.28-1.0.pkg.tar.gz
8. Restart into Mac OSX
9. Copy all these files to your Documents folder which is at /Users/
yourusername/Documents or click on Home then Documents
10. Open Terminal application, which inside Applications | Utilities
11. First install mySQL:
12. Go to Documents folder from Terminal. Type the following at 
the Terminal prompt (the ">" represents the prompt, so don't type 
it):
> cd ~
> cd Documents
> ls
Do you see the files? If you don't, type the following:
> pwd
to check if you're in the right directory: /Users/yourusername/
Documents
13. Unpack MySQL:
> gnutar xpfz MySQL-3.23.28-1.0.pkg.tar.gz
14. Go out of Terminal and in Finder, go to your Documents folder 
and double-click on resulting package.
15. Apple's Installer will ask for admin password (click on the 
"lock" icon). Enter your password then run the installer.
16. Quit installer when finished.
17. Go back to Terminal application and type the following:
> su
Enter your Root password
> cd /usr/local/bin
> ./mysql_install_db
18. That's it, MySQL is installed. To run server, type the following at 
Terminal as Root:
> safe_mysqld &
19. Your Terminal will just stop (won't go back to prompt) but that's 
okay. You can close Terminal.
20. I'm assuming you know how to run and use mysql. If you don't 
know how to create a new user aside from Root with database 
creating privileges, this is how: At Terminal, type the following as 
Root:
> mysql
Inside mysql, type the following ("m>" represents mysql prompt, 
don't type it):
m> GRANT ALL PRIVILEGES ON *.* TO [email protected] 
IDENTIFIED BY 'whateverpasswordyouwant';
m> quit
Exit root:
> exit
Now to run mysql as you and create a new database, etc., you 
must do the following:
> mysql -pwhateverpasswordyouwant test
m> create database myfirstdatabase
m> quit
> mysql -pwhateverpasswordyouwant myfirstdatabase
21. Install Apache. First turn off Mac OSX Apache. Go to System 
Preference | Sharing, make sure WebServer is off (buttons says 
"Start" instead of "Stop"):
22. Go back to where you placed Apache package. Do this at 
Terminal:
> cd ~
> cd Documents
> gnutar xzf apache_1.3.19.tar.gz
> cd apache_1.3.19
> ./configure --enable-module=most --enable-shared=max
> make
> sudo make install
You'll be asked for Root password. Give it then run.
That's it, you've installed Apache.
23. Let's install PHP next before you run Apache:
24. Go back to where you placed PHP package. Do this at 
Terminal (become Root):
> su
Enter your Root password
Next, configure PHP (the disable pear is because your file system, 
HFS+ is case-insensitive, and installing pear causes errors)
> ./configure --with-mysql --with-apxs --disable-pear
In my case, I also added dBASE support, so if you want, you can 
type the following or add other configurations. Consult PHP.NET 
regarding the others:
> ./configure --with-mysql --with-dbase --with-apxs --disable-pear
> make
> make install
When it's finished, open the following file using at the Terminal 
using the Pico text editor:
> pico /etc/httpd/httpd.conf
Do a search for all things PHP (it's Ctrl-w):
Make sure the following are in there and not commented out 
(comments take the form of "#"), if not add them at the appropriate 
place, which is, together with what looks like them:
LoadModule php4_module		libexec/httpd/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
You may also want to modify the following so that Apache will let 
you go to your PHP page without having to type the file name if it's 
a default:
<IfModule mod_dir.c>
    DirectoryIndex index.html index.php index.php3
</IfModule>
25. Okay, finished with PHP.
26. Now do the following to make Apache accessible from 
browser:
27. Go to Systems Preference | Network
28. Create a new Location (click on Location pulldown menu and 
select "New...")
29. Call the new Location "Local" or whatever you want, but make 
the following settings:
Configure: Manually
IP Address: 127.0.0.1
Router: 127.0.0.1
Leave all the other settings the way they are. Save it.
30. Run MySQL (I mentioned this earlier. To check if it's running, at 
the Terminal, type > mysqladmin -v ping). Run Apache: at System 
Preference | Sharing turn on WebServer by clicking on "Start" 
button.
31. Go to your browser, like Ominweb or (blech) Microsoft IE (can't 
wait for Mozilla or Netscape port to OSX):
32. Type at Location: http://127.0.0.1 -- you should end up at 
Apache welcome screen.
33. Your programs need to be placed in: /Library/Webserver/
Documents which is accessible from Finder. Try putting in a PHP/
Mysql program and see results in your browser. For example, if I 
place in "first.php" then at browser, you type: http://127.0.0.1/
first.php
If you put in a folder inside /Library/Webserver/Documents, then 
just use the name of the folder (no spaces) in the browser. 
Example, if folder is called "myprogs": http://127.0.0.1/myprogs/
first.php
Phew! Good luck.
http://www.webs4soft.com/Links4.htm
http://hotelsinindia.webs4soft.com/hotels-in-delhi.htm
http://indiatravel.webs4soft.com/Resources.htm
http://indianmovies.webs4soft.com/Kuch-Kuch-Hota-Hai.htm
http://real-estate.webs4soft.com/property-tips.htm
http://foodhealthcaretips.webs4soft.com/Resources.htm
http://www.websitecompanyindia.com/seo-Links.htm
http://www.websitecompanyindia.com/seo-Links.htm
http://indianjewelry.websitecompanyindia.com/dimond-ring.htm
http://www.bestindiaeducation.com/Link-Exchange.htm
http://bestjobconsultant.bestindiaeducation.com/PARTNERS.htm
http://eloctronicandmobilestore.bestindiaeducation.com/mobile-links.htm
http://easyloanservice.bestindiaeducation.com/Home-Insurance-Links.htm
http://www.rajhealthcenter.com/Cosmetic-Surgery.htm
http://creativebusinessgroup.rajhealthcenter.com/Business-Links.htm
http://onlinefreeinternetgames.rajhealthcenter.com/Games-Links.htm
http://top-beauty-tips.rajhealthcenter.com/Beauty-Links.htm
http://www.indiatourpoint.com/Travel-Links.htm
http://four-wheeler-buy-tips.indiatourpoint.com/Auto-Links.htm
http://watch-online-free-cricket-match.indiatourpoint.com/Sports-Links.htm
http://directory.indiatourpoint.com/
http://www.bestlifeindia.com/Resources1.htm
http://directory.bestlifeindia.com/
http://freeorkutscrapandsms.bestlifeindia.com/SMS-Links.htm
http://onlinegiftshop.bestlifeindia.com/Gift-Links.htm
http://www.freemusicpoint.com/Music-Links.htm
http://love-dating.freemusicpoint.com
http://online-art-presentation.freemusicpoint.com/
http://onlinefurnitureshop.freemusicpoint.com/