Re: php4 and apache on SuSE Linux

From: Date: Thu, 13 Sep 2001 10:45:22 +0000
Subject: Re: php4 and apache on SuSE Linux
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67175@lists.php.net to get a copy of this message
Hi Sean, What webserver are you using? Is it using the Apache module of PHP or the CGI version? Perhaps the extension of your file doesn't have the PHP processor associated with it (if it is installed as an Apache process)? Maybe you are using the CGI version incorrectly? With the command line version, you still need the <?php ?> tags before it will process the PHP code. e.g. #!/usr/bin/php <?php echo "Hey, I am working fine."; ?> That should work as you expect. Cheers, Kelly. > I am trying to run a simple php4 script on my SuSE Linux 7.2 (Update) > system, but I am not getting the correct output. Instead of the browser > (Netscape or Konqueror) showing a normal web page, it shows the raw > commands from the php script portion of the html file. > > Here is the script I am using: > > <html> > <head> > <title>PHP Test Example</title> > </head> > <body> > <?php > > echo <hr>; > echo date("H:i, jS F"); > echo <p>; > echo Hi, I am a PHP script!<p>; > echo <hr>; > > ?> > </body> > </html> > > When I open this file with konqueror or Netscape, the browser window > carries the title "PHP Test Example", but the output within the browser > window looks like this: > > ; echo date("H:i, jS F"); echo > > ; echo Hi, I am a PHP script! > > ; echo > -------------------------<a horizontal rule>___________________ > ; ?> > > Furthermore, if I run a simple script from the command line, something like > this ("trythis.php"): > > #!/usr/bin/php > > echo "Hey, I am working fine."; > > this is the output I get: > > tschulze:~/web_dev/schulze> ./trythis.php > X-Powered-By: PHP/4.0.4pl1 > Content-type: text/html > > > echo "Hey, I am working fine."; > > tschulze:~/web_dev/schulze> > > Any idea what I need to do to get this working right? > > TIA, > Sean > > hussar256@hotmail.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#67175) next »