Page 1 of 2

I can not run the phpinfo.php uploaded by FTP

Posted: Thu May 12, 2016 12:05 am
by baijianpeng
I installed VestaCP on CentOS 7 64-bit, then installed Multiple PHP Selector by skamasle.

Now I want to run a phpinfo.php file to see the PHP information of my server.

I uploaded the file phpinfo.php to my web root and tried to visit that file in my browser, I got following error message:
Forbidden

You don't have permission to access /phpinfo.php on this server.
How to fix this?

Thank you.

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Thu May 12, 2016 1:55 pm
by skamasle
What permisions have your files ?

You need do a chmod 644 phpinfo.php

You can change permisions whit your ftp client also.

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Thu May 12, 2016 2:58 pm
by baijianpeng
I tried 644, 755, 777, all can not work.

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Sun May 15, 2016 9:59 am
by tjebbeke
Have you uploaded the file with the right account?

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Sun May 15, 2016 11:03 am
by baijianpeng
Yes, there is only one user "admin", I just uploaded via this account on FTP.

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Sun May 15, 2016 8:32 pm
by mehargags

Code: Select all

chown -R admin:admin /home/admin/web/<yourdomain>/public_html
replace <yourdomain> with name of domain that you made in your VestaCP under which your PHPinfo file is residing

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Mon May 16, 2016 12:19 pm
by baijianpeng
Why assign the owner as "admin"? I created the website (domain) and FTP account under another user of VestaCP, not admin.

Are you sure I should change the owner to "admin"?

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Mon May 16, 2016 4:26 pm
by mehargags
yes you can either do admin:admin or user:admin both will work because the admin user has all rights for www and execution of scripts.

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Wed May 18, 2016 2:14 pm
by tjebbeke
baijianpeng wrote:Yes, there is only one user "admin", I just uploaded via this account on FTP.
baijianpeng wrote:Why assign the owner as "admin"? I created the website (domain) and FTP account under another user of VestaCP, not admin.

Are you sure I should change the owner to "admin"?
You are contradicting yourself ...

Execute this command and replace <username> with the owner of the domain.
chown -R <username>:<username> /home/<username>/web/<yourdomain>/public_html

Re: I can not run the phpinfo.php uploaded by FTP

Posted: Thu May 19, 2016 2:30 am
by baijianpeng
sorry, I have two VPS both have this problem. One is remote, one is local on Virutalbox. I had mixed them up.

In fact, the "php file can not be executed" problem exists on both of them.

I will try your method today.

Thank you.