Problem to run file

Hi,
I run the file like
5j.png
but it cannot show the web-page as expected.
LVL 11
HuaMin ChenSystem AnalystAsked:
Who is Participating?
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
This opens Firefox to the same page.

[davidc@dibscos6 ~]$ firefox http://localhost/phpinfo.php
0
 
Dave BaldwinFixer of ProblemsCommented:
Since you are running from the command line, the most you should expect is a text display in the terminal.  That will not launch a browser that will show you a web page.  And if the PHP command line is not installed or enabled, it may not show you anything but an error.
0
 
HuaMin ChenSystem AnalystAuthor Commented:
PHP command line is installed already. How to run the .php file?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Dave BaldwinFixer of ProblemsCommented:
This is all I have to do.

[root@dibscos6 html]# php phpinfo.php
0
 
HuaMin ChenSystem AnalystAuthor Commented:
I'm running that in the same way like you. Why can't the .php file be displayed on browser?
0
 
Dave BaldwinFixer of ProblemsCommented:
That command runs the PHP program in the terminal and the web browser (Firefox) does not run in the terminal.  To run Firefox from the command line to view that page, you would have to start Firefox, not PHP.  I'll show you in the next comment.
0
 
HuaMin ChenSystem AnalystAuthor Commented:
I then get this
Screenshot-1--1-.png
0
 
HuaMin ChenSystem AnalystAuthor Commented:
I get the current problem when issuing
firefox http://localhost/info5.php

while info5.php does exist within
/var/www/html/
0
 
Dave BaldwinFixer of ProblemsCommented:
Can you connect to any other page like index.html?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.