I am running virtualmin on localhost. I have created a virtual server but I do not know how to execute PHP scripts on neither my normal user account or my virtual server account.
I have a hello.php script under public_html folder on the virtual server account. How do i access this script on the browser?
Also since I will have to develop my projects under my main user account (i.e. account where I installed VMin), how do I run php scripts from there too? Where do i put the files/folders and how do i access them from the browser?
thanks for any help
You access your “hello.php” under “http://serverdomain/hello.php”, provided you are using resolvable domain names, or have pointed your client’s DNS configuration to your Virtualmin server.
You can also use “http://localhost/hello.php” or “http://127.0.0.1/hello.php”, provided you configured the virtual server to be the default for the host.
Can you elaborate “run php scripts from main user account”, I didn’t really get that.
thanks for your reply. I checked the virtual server .conf file and found the server alias name which i used and it worked. That kinda corresponds to the “http://serverdomain/hello.php” you suggested. Dont know what you mean by resolvable domain names though. Pls can you explain that to me just for information reasons? Thanks
[Qoute]Can you elaborate “run php scripts from main user account”, I didn’t really get that.[Quote]
What i am tryna say is when i go to http://localhost for example, it serves files from /var/www/ (and not from the /home/servername/public_html directory as when accessing a file from a virtual host). But only html files are being served correctly from /var/www. when i do http://localhost/xyz.php I just get a blank page.
I am guessing this is a php config that is caused by installation of the php via Virtualmin and a simple setting might just fix it but i just dont know how. I am quite new to linux and vmin and all. Please where can i check? Thanks
“Resolvable name”: An official, externally registered domain name like “mytesthost.mytestdomain.com”. If you use that for your development Virtualmin virtual server, all machines in your LAN will know that hostname (because it is resolvable in the entire Internet). If you don’t, you need to configure the DNS client on your LAN machines (including the development machine) to use your Virtualmin server as nameserver, if you wish to use anything beyond “localhost”.
Virtualmin is not meant to run web stuff from /var/www (for security reasons). It contains special versions of suexec and stuff that only execute PHP from /home. You should put all your development sites in virtual servers under /home.