Jump to content

Cant execute PHP to browser


sinan92
 Share

Recommended Posts

I can't execute the PHP file to the browserI tried it with both IE and FirefoxThis is the code:

<html><body><?phpecho "Hello World";?></body></html>

Later on I downloaded PHP and installed it which caused this problem when I open the php file as Firefox on IEPHPproblem.png

Link to comment
Share on other sites

try using http://localhost/php/hello.php you are using absolute path like C://xampp....which will not execute it it will just open it.

Edited by birbal
Link to comment
Share on other sites

try using http://localhost/php/hello.php you are using absolute path like C://xampp....which will not execute it it will just open it.
Then I just get nothingAll I get is an empty pagePhpProblem2.pngTried both Localhost and 127.0.0.1 they didn't workI started Xampp but it didnt work with that eitherI did notice that Xampp somehow cant start Apache thoughI dont know if it has to do with PHPfile:///C:/xampp/htdocs/index.xhtmlThat does work but only with xhtml or html When I try it with php it gives the first errorAlso when I try to open the xhtml file this way:http://127.0.0.1/index.xhtmlIt gives me this error
XML-parsefout: geen element gevondenLocatie: http://127.0.0.1/index.xhtmlRegelnummer 1, kolom 1:^

Means that no elements were found on that location at row 1 col 1: ^

Edited by Xegano
Link to comment
Share on other sites

Apache needs to be running. PHP runs on a web server. You should figure out why Apache is not starting and then try opening the file in your browser, pointed to localhost.

Edited by thescientist
Link to comment
Share on other sites

Apache needs to be running. PHP runs on a web server. You should figure out why Apache is not starting and then try opening the file in your browser, pointed to localhost.
Alright I will try to find outThis is what XAMPP says btwXAMPP.pngCould it be that the port should be forwarded for it?
Link to comment
Share on other sites

It looks like apache is not being started. you may like to check the error log for apache to figure out what problem is ocuring

Link to comment
Share on other sites

It looks like apache is not being started. you may like to check the error log for apache to figure out what problem is ocuring
Ah but ofcourse! It was Skype which blocks port 80 :)Thanks a lot guys :)Now I can finally start learning PHP lol Edited by Xegano
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...