image
image

Go Back   macosx.com > Community > Opinions, & Open Letters

Reply
 
LinkBack Thread Tools
  #1  
Old June 7th, 2005, 01:42 PM
andehlu's Avatar
this modern love
 
Join Date: Feb 2004
Location: torontoCANADA
Posts: 244
Thanks: 0
Thanked 0 Times in 0 Posts
andehlu is on a distinguished road
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.
__________________
site | blog | garageband experiments
Reply With Quote
  #2  
Old June 7th, 2005, 02:04 PM
Registered User
 
Join Date: Nov 2004
Location: Florida
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
ngcomputing is on a distinguished road
Try right clicking a php file in finder then select Open With and choose other, then select Safari.
Reply With Quote
  #3  
Old June 7th, 2005, 05:59 PM
andehlu's Avatar
this modern love
 
Join Date: Feb 2004
Location: torontoCANADA
Posts: 244
Thanks: 0
Thanked 0 Times in 0 Posts
andehlu is on a distinguished road
ya tried that ....no go......
__________________
site | blog | garageband experiments
Reply With Quote
  #4  
Old June 9th, 2005, 02:38 AM
texanpenguin's Avatar
Registered Penguin
 
Join Date: Feb 2003
Location: Australia
Posts: 881
Thanks: 0
Thanked 0 Times in 0 Posts
texanpenguin is on a distinguished road
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
Reply With Quote
  #5  
Old June 9th, 2005, 05:15 PM
andehlu's Avatar
this modern love
 
Join Date: Feb 2004
Location: torontoCANADA
Posts: 244
Thanks: 0
Thanked 0 Times in 0 Posts
andehlu is on a distinguished road
yup i even have apache running.... i think its mamp thats getting in the way...
__________________
site | blog | garageband experiments
Reply With Quote
  #6  
Old June 10th, 2005, 03:49 AM
Registered User
 
Join Date: Jul 2002
Posts: 381
Thanks: 0
Thanked 1 Time in 1 Post
elander will become famous soon enough
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/
__________________
/elander
website: http://www.scribus.se/
Reply With Quote
  #7  
Old June 10th, 2005, 04:46 AM
texanpenguin's Avatar
Registered Penguin
 
Join Date: Feb 2003
Location: Australia
Posts: 881
Thanks: 0
Thanked 0 Times in 0 Posts
texanpenguin is on a distinguished road
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
Reply With Quote
  #8  
Old June 10th, 2005, 07:33 AM
Registered User
 
Join Date: Jul 2002
Posts: 381
Thanks: 0
Thanked 1 Time in 1 Post
elander will become famous soon enough
Quote:
Originally Posted by texanpenguin
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
Bull. It READS the code, and presents it as is, but it does not PARSE or EXECUTE. It will parse HTML if it's present in the code, but it will NEVER parse PHP on its own.

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.
__________________
/elander
website: http://www.scribus.se/
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 02:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.