PHP - How to Execute Script

PHP scripts are unable to execute as normal html web pages thus php scripts are run only on the web servers. Therefore before executing the scripts, you should run your web server. All the php pages should be located inside the web server folder.

  • Through Wamp Server 
    Running wamp server and put it online before doing the execution. You can see a folder named "www" inside the wamp folder located in your C drive. PHP script pages should be located within that folder. It is better to create a folder and save all the documents there.
    PHP files cannot access with its full path like html (Ex: C:/wamp/www/php/hello.php). That www folder act as your local web server stored location and therefore you can call the above path "http://localhost/php/hello.php".
    localhost or 127.0.0.1 : this is the dns address of your web server located in your machine.
    php : php folder created in www folder.

    I think now you are familiar with storing php script pages.
  • See how to run php files with wamp server

No comments:

Post a Comment