barakolshe Posted July 19, 2017 Share Posted July 19, 2017 (edited) Hello, I have started learning php recently, but I feel like I don't understand the basics of it. here is a simple php file I ran in my broswer: <html> <body> <p>Hello<p> <?php echo "<p>World!</p>"; ?> </body> </html> But instead of displaying Hello World!, the browser(chrome) presents this: Hello World! "; ?> and I don't know how to get rid of the last characters. Edited July 20, 2017 by cyberRobot removed the rogue [/size] tags Quote Link to comment Share on other sites More sharing options...
requinix Posted July 19, 2017 Share Posted July 19, 2017 It means you don't have PHP running. Do you have Apache installed? Maybe with WAMP or XAMPP? Does the URL in your browser start with "http://" and end with ".php"? Quote Link to comment Share on other sites More sharing options...
Sepodati Posted July 19, 2017 Share Posted July 19, 2017 (edited) As mentioned, you need to run your own webserver with PHP in order to process PHP files. That's not hard, just install Apache. Then make sure your test file has a .php extension and you load it in your web browser as a URL, with http://. Such as http://localhost/test.php. "localhost" refers to your local computer, where you hopefully just installed Apache. If you just double-click on the file, it's not actually loading it via Apache. The "test.php" has to be in a specific file location so Apache can read it correctly. I know it's /var/www/html/ on Ubuntu, but I forget where the folder is at on Windows. Edited July 19, 2017 by Sepodati Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.