1829743 Members
1657 Online
109992 Solutions
New Discussion

Re: RedHat 8.0 & PHP

 
SOLVED
Go to solution
Ng King Wang
Respected Contributor

RedHat 8.0 & PHP

Hello all,

During installing RedHat 8.0, I also chose to install PHP.

But when I test PHP with the following "test.php" file, nothing is displayed on browser.

Content of "test.php"



phpinfo();
?>



Is there any command for me to start and stop PHP service, check the status of PHP service on RedHat 8.0?

Thanks in advance :)
We master OpenView, my Lord masters us.
7 REPLIES 7
John Meissner
Esteemed Contributor

Re: RedHat 8.0 & PHP

I recently installed RH 8.0 - but i'm not familiar with PHP - what's it stand for? I'll be happy to help in anyway
All paths lead to destiny
Ng King Wang
Respected Contributor

Re: RedHat 8.0 & PHP

Hello,

PHP is a server-side web programming language that you can embed into HTML pages. When a user accesses a PHP-based page, PHP dynamically creates a web page that is then passed to the browser.

You can have a look on the following URL for getting more idea:

http://www.redhat.com/docs/manuals/database/RHDB-2.1-Manual/prog/c7773.html

Thanks :)
We master OpenView, my Lord masters us.
Stuart Browne
Honored Contributor

Re: RedHat 8.0 & PHP

Where did you put this file, and by what URL did you try to access it from?

What does 'rpm -qa "php*"' report?

Is your web-server listening ? Confirm by issuing these two commands:

ps -fp $(netstat -ntlp | grep http

Did any errors show up when you started the web service? Look in /var/log/httpd/error_log

Restart the web server, and watch it if you're unsure ("service httpd restart").

Does the same thing happen if you use long tags, not short tags (change "
One long-haired git at your service...
Ng King Wang
Respected Contributor

Re: RedHat 8.0 & PHP

Hello Stuart,

I put "test.php" on the following folder:
/var/www/html

Following is the file and directory in /var/www/html:

[root@es1 html]# ls
test.php usage

I enter the following URL on the browser:
http://202.123.213.5/test.php

Follwing lines are the output I got:

[root@es1 kwng]# rpm -qa "php*"
php-4.2.2-8.0.5
php-imap-4.2.2-8.0.5
php-pgsql-4.2.2-8.0.5
php-ldap-4.2.2-8.0.5

[root@es1 kwng]# ps -fp $(UID PID PPID C STIME TTY TIME CMD
root 6395 1 0 2002 ? 00:00:01 /usr/sbin/httpd

[root@es1 kwng]# netstat -ntlp | grep http
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
6395/httpd
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
6395/httpd

By the way, i do not understand the meaning of "use long tags". Should I put
"" in one line?

Thanks :)
We master OpenView, my Lord masters us.
Stuart Browne
Honored Contributor
Solution

Re: RedHat 8.0 & PHP

*pokes*prods* wow.. what a stuff-up on RH's behalf!

*pokes it some more* wow..

Have a RH8 box here. Same thing. Never noticed.

*poke* Ahh.. Yes..

By default, RH8 configures PHP to require the use of 'long tags'.

You have two choices. One, use long tags:

phpinfo();
?>

Two, change PHP's configuration to use short tags:

/etc/php.ini, change:

short_open_tag = Off
to
short_open_tag = On

This should fix your issue.
One long-haired git at your service...
Ng King Wang
Respected Contributor

Re: RedHat 8.0 & PHP

Thank you, Stuart.

Can I configure RedHat 8.0 to support both long tags and short tags?


We master OpenView, my Lord masters us.
Stuart Browne
Honored Contributor

Re: RedHat 8.0 & PHP

PHP always supports Long tags. Changing that option will make it support both.
One long-haired git at your service...