Re: [PHP] php4 and apache on SuSE Linux
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 titlePHP 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 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php4 and apache on SuSE Linux
Try: html head titlePHP 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 Rudolf Visagie [EMAIL PROTECTED] -Original Message- From: T.Sean Schulze [mailto:[EMAIL PROTECTED]] Sent: 13 September 2001 11:47 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] php4 and apache on SuSE Linux 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 titlePHP 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 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php4 and apache on SuSE Linux
Rudolf, I have tried adding the double quotes, and when I do, nothing at all is displayed. Adding single quotes to the script, just adds single quotes to the output. Sean Rudolf Visagie wrote: Try: html head titlePHP 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 Rudolf Visagie [EMAIL PROTECTED] -Original Message- From: T.Sean Schulze [mailto:[EMAIL PROTECTED]] Sent: 13 September 2001 11:47 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] php4 and apache on SuSE Linux 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 titlePHP 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 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php4 and apache on SuSE Linux
It sounds like the PHP isn't getting parsed. Check the webserver is configured correctly for the extension of your file, or that your system requires you to use the CGI version of the PHP interpreter. Rudolf, I have tried adding the double quotes, and when I do, nothing at all is displayed. Adding single quotes to the script, just adds single quotes to the output. Sean Rudolf Visagie wrote: Try: html head titlePHP 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 Rudolf Visagie [EMAIL PROTECTED] -Original Message- From: T.Sean Schulze [mailto:[EMAIL PROTECTED]] Sent: 13 September 2001 11:47 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] php4 and apache on SuSE Linux 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 titlePHP 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 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php4 and apache on SuSE Linux
Hi Sean, When I run your code on our Linux Mandrake, Apache server (standard PHP4 installation) without the double quotes it gives: Parse error: parse error, expecting `','' or `';'' in /home/httpd/html/rudolf/test.php on line 8 With the double quotes I suggested it gives the expected result, so Kelly is correct thinking that your code does not even get parsed. Why, I've no idea. Rudolf -Original Message- From: T.Sean Schulze [mailto:[EMAIL PROTECTED]] Sent: 13 September 2001 03:32 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] php4 and apache on SuSE Linux Kelly Barrett wrote: Hi Sean, What webserver are you using? Is it using the Apache module of PHP or the CGI version? I will admit to being a newbie, but I am pretty sure that I am using the module version. My /etc/httpd/httpd.conf file includes these lines: IfDefine PHP LoadModule php3_module /usr/lib/apache/libphp3.so /IfDefine IfDefine PHP4 LoadModule php4_module /usr/lib/apache/libphp4.so /IfDefine and these: # # AddType allows you to tweak mime.types without actually editing it, or to # make certain files to be certain types. # # For example, the PHP 3.x module (not part of the Apache distribution - see# http://www.php.net) will typically use: # IfModule mod_php3.c AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .phps AddType application/x-httpd-php3 .phtml /IfModule # # And for PHP 4.x, use: # IfModule mod_php4.c AddType application/x-httpd-php .php AddType application/x-httpd-php .php4 AddType application/x-httpd-php-source .phps /IfModule Perhaps the extension of your file doesn't have the PHP processor associated with it (if it is installed as an Apache process)? See above. Maybe you are using the CGI version incorrectly? I think I am using the module. 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. Thanks for that tip. That fixed the command line script I was working on. Now, if I could get the module working... I think I just figured it out. I think the problem was the location of the file. I was trying to open a file in my home directory, not in apache's DocumentRoot directory as defined in the httpd.conf file. Once I moved the file there, it ran fine. Thanks you all for your help. Cheers, Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]