I am presently creating a website which will take advantage of PHP scripts and Let me have the ability to test them out on my small local machine before pushing them to the server, however I am getting problems doing that. Typically, I keep my development projects inside a folder call ~/Projects/projectName, but that does not appear to become a choice with web scripting. I have read that I have to install Apache (which I have done) and PHP (also done) after which move my project in to the web server's root directory situated at
/var/www (I am on Linux) that we haven't done since this is a system directory and that i will not have the ability to edit my files inside.
I have looked around there does not appear to become in whatever way of invoking a PHP script from the web page anywhere but that one directory. I have attempted soft-connecting my
~/Projects/projectName directory into
/var/www, consider it is a subdirectory from the web server's root, that's leading to permission errors after i attempt to access the file at
Can there be in whatever way to accommodate my files during my Projects folder but still have the ability to run them in your area without an excessive amount of hassle?
You have to produce a new Apache Virtual Host configuration to suggest for your
~/Projects/projectName folder as it is webroot.
This is a very fundamental configuration for your kind of setup
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org ServerName www.mysite.com DocumentRoot /home/john/Projects/projectName </VirtualHost>
It seems like you will possibly not have root or sudo access because you can't email
/var/www too... Modifying your Apache config requires similar rights.
if you work with a professional linux distribution like opensuse, you'll have the ability to customize the root_dir with YaST2 easely, otherwise you will need to modify httpd.conf configuration to define the net root directory (location is dependent, some occasions you'll find it in /etc/apache2/conf.d)
or just, login as root (command line : su) and chmod your webroot directory (command line : chmod 777 /var/www)