Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

onlyONE

macrumors member
Original poster
Jun 14, 2006
47
0
I'm trying to create my first PHP website, with PHP includes and a few PHP databases. Only problem is I can't check my script and code, because Safari won't open my files, when I choose a program to open the file, Safari is displayed as an unavailable option. If it's easy to fix can someone please guide me in the right direction? If it's not and Safari is going to be fussy, what is the best alternative browser available for an Intel Mac? Thanks!
 
Oh, yuck. So they won't just run on my hard drive? That's rather unfortunate. Thanks for the post though! :)
 
Well you may be able to run them locally ... I don't know much about OS X's built-in Apache server. PHP works pretty easily with Apache, though, so anything is possible.

I'm sure someone else will chime in shortly with a link to a tutorial or how-to. :)
 
As PHP is a server side language you will need to setup a web server on your computer so you can learn PHP.

PHP is one of my favorite languages because it is fun and easy to use and powerful.

To get a server up and running really fast, download MAMP:
http://www.mamp.info/

This will setup PHP, apache, mysql, and phpmyadmin.

These tools are very helpful when developing php applications.

I would also recommend using TextWrangler from barebones.com. This will help you program your code in php. It has nice features such as syntax highlighting and advanced searching.
 
michaeldmartin said:
Some web development apps will run the scripts. (Like dreamweaver)

Yes, but dreamweaver is the root of all evil.


Install MAMP. It's free, unlike DW, and will do exactly what you want.
 
blasto333 said:
As PHP is a server side language you will need to setup a web server on your computer so you can learn PHP.

PHP is one of my favorite languages because it is fun and easy to use and powerful.

To get a server up and running really fast, download MAMP:
http://www.mamp.info/

This will setup PHP, apache, mysql, and phpmyadmin.

These tools are very helpful when developing php applications.

I would also recommend using TextWrangler from barebones.com. This will help you program your code in php. It has nice features such as syntax highlighting and advanced searching.

Okay, I have downloaded MAMP onto my computer, I use Smultron as my HTML editor, and love it. If it turns out that TextWrangler is a superior choice I will certainly switch. How can I view the .php files? I am runnin the My SQL & Apache servers from MAMP, but can't figure out how to open my files...lol. :confused:
 
By hosting it; turn the server on and put the files in the correct directory// I remember there being a shared folder for webpages or something; I don't remember what it was before i installed OS X server on the server..
 
Okay, I have turned on the built in PHP server in OS X, enabled Person Web Sharing and went into my website through System Preferences. I have a website named with a .html extension and that one works fine when I open to view it, however if I try to open .shtml files or .php files they all just show up in Safari as code. :confused: Ug. Thanks so much for bearing with me guys, you're tons of help! :)
 
onlyONE said:
Okay, I have turned on the built in PHP server in OS X, enabled Person Web Sharing and went into my website through System Preferences. I have a website named with a .html extension and that one works fine when I open to view it, however if I try to open .shtml files or .php files they all just show up in Safari as code. :confused: Ug. Thanks so much for bearing with me guys, you're tons of help! :)

How are you trying to open them? By directly running the file in the finder? You need to access them via http. So if your index.php file is in your ~/sites/ folder, you need to access it by typing http://localhost/~yourusernamehere/index.php in your browser.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.