Re: Please Help with simple Noob problem

From: Date: Thu, 11 Jan 2007 16:48:45 +0000
Subject: Re: Please Help with simple Noob problem
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-246927@lists.php.net to get a copy of this message
Please keep it on-list. Scott Bounds wrote:
by the way, I did view source and it seemed to recognize the opening php tag (<?php) but didn't recognize the closing tag (?>). I am assuming that in that evidently FC2 likes to color code the tags (php is with purple) and it had the opening tag colored purple, but the closing tag was black. It also (in the web page) displayed the closing tag like regular text.
Are you saying that you see the <?php and ?> when you view the source of the page? If so then your configuration in Apache is wrong. Please do as I said and read the manual page regarding installing PHP4 on Apache2, following the instructions and check the Apache error log.
I tried to put the line in about loading the module (mine is php4) and apache complained saying that it had already been called (from the conf.d file). I did however add the following: # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # AddType text/html .shtml AddOutputFilter INCLUDES .shtml AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps AddType application/x-httpd-php .phtml I then restarted apache (service httpd restart) and tried viewing the pages again; same outcome.
Check the Apache error log - I'm guessing it's failing to initialise the PHP module. -Stut
On Thu, 2007-01-11 at 09:59, Stut wrote: Scott Bounds wrote:
Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc.
View the source of your page in the browser. If you see the PHP code chances are you haven't told Apache about PHP. Read the manual (yes, there is a manual: http://php.net/install.unix.apache2) for specific instructions, but your httpd.conf needs at least the following two lines (paths on your system may differ)... LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml -Stut


« previous php.general (#246927) next »