Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



 
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
Old 05-08-2004, 07:21 AM   #1
georgeocrawford
Triple-A Player
 
Join Date: Jan 2004
Posts: 215
.phps PHP source question

Hi,

I'm working on a complicated set of PHP scripts on my home machine at the moment. When at a friends house demonstrating one of them, I wanted to show him the source of a script. Sure, I could have SSH'ed in, but I couldn't be bothered - I needed a quick demo.

I thought it would be really nice to have a *.phps version of every *.php file I have in my webserver. I am not bothered about secret scripts being read by the public - there's a .htaccess password protection on the whole webserver directory, and the scripts aren't at all secret.

I thought of two possible solutions. The second best would be some kind of folder action or something which meant that every time a file named *.php was added to the webserver directory, a symbolic link to the file, named *.phps, was added to the same directory. This method would have to cope with file renaming, moved files and deleted files too - can't really see it working.

The better solution would be some Apache config trickery. I don't know if this is possible, but it would be great.

Would there be a way for Apache to accept an incoming request for *.phps (a file which doesn't exist), find instead the equivalent *.php (i.e. as per the standard Apache alias directive), but hand it to the x-httpd-php-source application rather than the usual x-httpd-php. This would be perfect for me, as it doesn't require any extra files, and the files and filenames would always be up-to-date. I read bits of the Apache manual yesterday, but couldn't quite see if this would be possible. I have CGI PHP too - maybe I could use that somehow?

Please DON'T worry about security for this - I'll sort that out when I have a solution!
georgeocrawford is offline   Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:17 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Site design © Mac Publishing LLC; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of Mac Publishing LLC.
You Rated this Thread: