How Do I Store Php Files To My Localhost?
Monday, February 8th, 2010 at
11:23 pm
I’m trying to run PHP, both as a file by itself and embedded in HTML, and it won’t work! I have Apache up and running too! Someone told me I need to store files in the localhost, because when i type http://localhost/phpinfo.php it works!
Tagged with: Files • Localhost • Store
Filed under: PHP
Like this post? Subscribe to my RSS feed and get loads more!
you have to put the files inside of your DocumentRoot, this is defined in the file httpd.conf, if you are running apache it is defaulted to something like c:\program filesapachehtdocs (on windows) or something like that, but that is the main directory for your webserver. you can change your documentroot to whatever folder/directory you like………
I think he meant uploading it into your own server. If you server is installed locally.
Just upload the file to your root folder, under any domain name and it should work fine. And as far as HTML is concerned, if you have a working PHP version script in your server, just use normal html scripting to embed it. Try PHPmyadmin.
I’m not sure about local servers, but on payed hosts, all we do is edit the .htaccess file.
You must put all your files inside the document root for the sites. You can create directories or even just put the files directly there. Since you are using Apache your root folder will be the /htdocs/.
Good luck and have fun.