I discovered something. I ended up opening the httpd.conf file and saw something odd-I was using TextWrangler and had turned on line numbers and saved it with numbers turned on. I feel stupid! I turned them off and then went back to my page and it works as far as Apache is concerned. It is still showing the variable names. I did copy the page code and used Pastie. I hope I did it right. The link is:
I also found out that there’s an original httpd.conf file in etc/apache2/originals. I have not edited anything. I had thought of copying that and redoing it according to your instructions. I remember when I first started this, it did not have a line about PHP5-I had to add:
LoadModule php5_module libexec/apache2/libphp5.so
Is there an easy way to make a page with Freeway to check the PHP and MySQL? I assume it is connecting just fine. I am understanding this all more and more thanks to your patient help!
This could all be a storm in a teakettle – we’re
running in circles trying to “fix” PHP, when the page has a syntax
error or something…
Oh cool! I tried another Freeway tutorial. It’s one by Mike Brackenridge just called mysql_dynamic. It included a mysql dump file. I got it to work! Obviously there’s a syntax error on my other file. I’ll have to fully look at it and absorb it when I’m not so tired!
One last question: I noticed when I look at the source code of the Axiom site (when the page is displayed in the browser), it is all html. Am I correct in thinking that the PHP code is executed first and then the page created is HTML that used PHP to create the code?
Thanks again for all your help. You have been incredibly patient and nice to work with. BTW, I looked at your own site. Nice work-on your own and on your client’s.
The line numbers are never made a part of the resulting file. They
appear on your screen only. If you want to confirm this, please try
the following (in your /etc/apache2/ folder)
pico -w httpd.conf
Do this before and after saving the file with line numbers on.
Walter
On May 6, 2008, at 5:56 PM, Brisprad wrote:
something odd-I was using TextWrangler and had turned on line
numbers and saved it with numbers turned on. I feel stupid!
That’s the very point of PHP – the code part is executed on the
server, and its output is served along with the static HTML back to
the browser. None of your code ever leaks out to the visitor (unless
you make a grisly mistake, like leaving off the <?php ?> delimiters).
Note that if you preview PHP locally using Freeway’s “Preview in
Browser” function, you will see the code; but that’s because the
browser is simply opening the file as a text file. The PHP
interpreter is not getting invoked.
Walter
On May 7, 2008, at 3:48 AM, Brisprad wrote:
One last question: I noticed when I look at the source code of the
Axiom site (when the page is displayed in the browser), it is all
html. Am I correct in thinking that the PHP code is executed first
and then the page created is HTML that used PHP to create the code?
Thanks again for all your help. You have been incredibly patient
and nice to work with. BTW, I looked at your own site. Nice work-on
your own and on your client’s.
I have read this thread and finally found the right question to ask.
Walter, you said the PHP interpreter is not getting invoked.
How do I do that?
I have MAMP running complete nice. OK with the infophp(), – but when I try a ordinary .php page in the browser it is not recognized. Firefox ask if it should be saved and Safari displays the code. Isn’t that funny??
I have changed the httpd.conf file uncommenting LoadModule php4_module libexec/httpd/libphp4.so and AddModule mod_php4.
I also managed to get php pages running by putting them in the folder Applications/MAMP/bin/mamp/ but only direct there, not in folders. Is that the only way? I would like to have all my sites in web pages folder as the OSX standard is.
(e.g, open the MAMP start page, and remove “MAMP/?language=English”)
David
On 27 Aug 2008, at 15:01, ulfr wrote:
I have MAMP running complete nice. OK with the infophp(), – but when I try a ordinary .php page in the browser it is not recognized. Firefox ask if it should be saved and Safari displays the code. Isn’t that funny??
David Owen
Freeway Friendly Web hosting and Domains ::
(Test Drive a web hosting account for Free)
When MAMP is running, it causes an instance of Apache + PHP to
“listen” at port 8888 for any requests that get sent to it. When you
type that URL into your browser, your browser sends a request to the
server named ‘localhost’, which is a fancy name for your own
computer, at that TCP/IP port. Because MAMP’s server is listening for
requests on that port, it responds to that request with whatever
specific resource was requested.
In simpler terms, you are temporarily running an entire Web server on
your local computer, and interacting with it as if it was www.apple.com or similar.
Walter
On Aug 28, 2008, at 9:21 AM, ulfr wrote:
Actually I had the folder right, htdocs but not Localhost:8888/,
consequenly I like to put another novice question:
How does Localhost:8888 work, besides linking to htdocs, it only
works when MAMP is running?