Hello,
This is a brief post on how to serve WAMP web files from a different location.
You will know WAMP as the popular Windows utility that allows you to serve PHP files sitting on top of an Apache HTTP web server. It works with the MySQL DBMS, although your PHP project can be configured to work with other DBMS.
Sometimes, you might want to you PHP files to be located from a different location. Most likely this is because you do not want potential hackers to go to the C: drive ( which is the most likely location you files would be served from ). It could also be because you want to place them in a location where it would be installed saved immediately to the cloud ( maybe a Dropbox or something else )
So, now that is out of the way, lets go to how to how to serve files from a different location. Follow these steps, and you would be just fine;
- Open the httpd.conf file found. This is found in the following location C:\wamp\bin\apache\apache<version number>\conf
2. Search for the following characters
${INSTALL_DIR}/www/
3. Change it to the new location. Lets suppose you want to change it to the R drive.Then you will change it to R:/phpFiles
4. Next open the httpd-vhosts.conf file found at the following location C:\wamp\bin\apache\apache2.4.23\conf\extra
5. Look for the following and change this c:/wamp/www to R:phpFiles
6.Restart the WAMP server.
That’s it. You are done.You can now serve files from locations other than your usual C drive. Hopefully this small tip, might be useful to you in your project setup. Until later, cheers.
Leave a comment