|
#1
| ||||
| ||||
| executing php files thru safari
Im not 100% sure how I did it in Panther but I could open php files and have them execute right thru safari (open with not thru localhost)....now i have MAMP installed on tiger, when I try to open php files thru safari they dont execute..... any ideas on how to do this? I find it a pain to launch MAMP and move everything to my htdocs directory....i did it once so.... thanks. |
|
#2
| |||
| |||
|
Try right clicking a php file in finder then select Open With and choose other, then select Safari.
|
|
#3
| ||||
| ||||
|
ya tried that ....no go......
|
|
#4
| ||||
| ||||
|
This might sound like a silly question, but have you turned on PHP? Or installed the new version? I don't think Safari has PHP as a registered file-type until you do.
__________________ 15" MacBook Pro Mac OS X v10.5.1 2.33GHz, 2GB RAM, 120GB HDD 5G iPod 60GB |
|
#5
| ||||
| ||||
|
yup i even have apache running.... i think its mamp thats getting in the way...
|
|
#6
| |||
| |||
| Nope.
I bet you ten bucks that you never were able to execute PHP code through Safari. Safari doesn't run the code through the PHP enginge, it will just read it. No execution. You're not remembering correctly. What you might have done, is opening a PHP document in an editor like HyperEdit, that does take advantage of the PHP engine, and is also capable of rendering html in a preview pane. That will still work, so try that. You'll find it here: http://www.tumultco.com/HyperEdit/ |
|
#7
| ||||
| ||||
|
elander, Safari parses PHP all the time, local or otherwise. Put you do need to install (or at least activate) PHP with the #-removing in httpd.conf
__________________ 15" MacBook Pro Mac OS X v10.5.1 2.33GHz, 2GB RAM, 120GB HDD 5G iPod 60GB |
|
#8
| |||
| |||
| Quote:
You could of course create a Safari plug-in, that would send the PHP code through the php or Zend engine, and then present the result to Safari. Possibly a good idea for testing local files, but I wouldn't recommend it, since it would also parse files received from a misconfigured server. As for parsing remote code, what are you thinking? A web server correctly configured to handle php-files never sends php code to the browser. It is parsed and executed on the server, and the results (HTML, XHTML, XML, text, images or other document types) are sent to the browser. It never sends any PHP code what so ever. Never. HyperEdit, on the other hand, can use any PHP engine that you have on your system (e.g. "/usr/bin/php" for the default or "/usr/local/php5" if you've installed PHP 5) to parse and execute the php commands. You can choose which one to use in the settings. The results that come back from the chosen engine are then displayed in a "preview" pane next to the editing pane. Safari does no such thing. You'll get the same results as if you opened the document in any text editor. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|