• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Executing custom php script - File not found ...

HelplessHobo

New Pleskian
Hi,
I'm trying to use a script created by the WP duplicator Plugin to duplicate Wordpress to my Plesk server.

In Plesk it says the website is at domainname/httpdocs/ so I deleted my current wordpress installation in that directory manually (sudo rm -r .) replaced it with the archive/installer and tried to browse to mydomain.tld/installer.php . Instead of the interface I got plain text telling me "File not found". Even set the files and directory to 777 with chmod, still nothing. Manually detached the Wordpress installation that was still on my domain in Plesk, now it tells me "no input file specified". Huh?

Does Plesk have some kind of automatic protection against this kind of script execution? When I did it on an apache without Plesk it worked out perfectly. I have mod_security installed if that changes anything.
 
As far as I know, at least at the point where the Wordpress installation is removed from Plesk, there is no security lock in place that could prevent the execution of a new script. I suggest to follow these steps to verify that the website is accessible in general:
a) Verify that no hidden files were left when deleting the content of /httpdocs. Sometimes there is an .htaccess file left that does some kind of redirection.
b) Check if the permissions of /httpdocs are set to 750.
c) Check if the owner of /httpdocs is
Code:
<username>:psaserv
d) Place a .php file into the /httpdocs directory, e.g. "phpinfo.php" with this content:
Code:
<?php phpinfo(); ?>
and open it in a browser, e.g. "http://<domainname>/phpinfo.php". This should display the PHP info page. If the page is displayed, everything is good and the error lies within the installer. If it is not display, try to run
# repair web domain <domainname>
on the console to ensure, that the web hosting parameters are all applied and set correctly.

Do any of these hints lead to the solution?
 
Ownership of the folder was messed up. No idea why since I didn't play with that until putting it to 777 but it works now. Thanks for the quick answer!
 
On a side-note ... what is the correct ownership of files so the "Fix File Permissions" Option of the WP Toolkit doesn't break the installation? Setting wp-config.php to 600? When you're usually supposed to have user:www-data as owner?
 
I think that for wp-config.php the permission should be 640, because the web server group ought be to able to read the file. For other files, permissions vary. The group you are looking at in the Plesk environment is not www-data, but psacln.
 
Back
Top