Unable to read or execute files from the WordPress root directory

Created:

2016-11-16 12:47:36 UTC

Modified:

2017-08-08 13:14:08 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to read or execute files from the WordPress root directory

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Symptoms

The error bellow is appeared when attempting to delete wordpres directory via WordPress Toolkit:

"/httpdocs/_backup": Unable to read or execute files from the
WordPress root directory." There is no such file/directory in the
affected hosted site, nor is there any "backup" at all in the site
"wp-config.php" file.

"/httpdocs/wp": This WordPress installation is not configured. Go to
the WordPress administrator's interface and finish configuring it. Then
click the Refresh button." This may be true but what does "scan" check
to determine this?

Cause

Nonexistent folder "_backup" was scanned by WordPress Toolkit but after this was removed via cli. WordPress Toolkit still have it in cache.

Resolution

To fix this issue go to the WordPress Toolkit > Click on affected instance with " httpdocs/_backup " > Click "Detach" .

If the steps above did not take effect, use the following steps to remove one of the wordpress instances form your domain. Example domain is 'example.com' .

  1. Back up relevant databases:

    # mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > ~/psa.`date +%F_%H:%M`.sql
    # mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` apsc > ~/apsc.`date +%F_%H:%M`.sql
  2. Find domain id:

    #plesk db
    MariaDB [psa]> select id from domains where name="example.com";
    +----+
    | id |
    +----+
    | 4 |
    +----+
  3. Find id's of wordpress instances for `'example.com':

    MariaDB [psa]> select * from WordpressInstancesDomains where domainid=4;
    +------------------------------+----------+
    | wordpressInstanceId | domainId |
    +------------------------------+----------+
    | 5 | 4 |
    | 6 | 4 |
    | 7 | 4 |
    +------------------------------+----------+
  4. Check if paths for those wordpress instances exists:

    MariaDB [psa]> select * from WordpressInstances where id in (5,6,7);
    +----+----------------+-----------------------+-----------+---------------+
    | id | subscriptionId | path | isIgnored | apsInstanceId |
    +----+----------------+-----------------------+-----------+---------------+
    | 5 | 4 | /httpdocs/wordpress | 0 | 5 |
    | 6 | 4 | /httpdocs/wordpress_f | 0 | 6 |
    | 7 | 4 | /httpdocs/wordpress_e | 0 | 8 |
    +----+----------------+-----------------------+-----------+---------------+

For example we want to delete wordpress instance in '/httpdocs/wordpress_e'Wordpress is an aps application so we need to remove entries about particular wordpress instance from apsc databse as well. To do that we need aps_application id and registry_object_id . aps_application id is apsInstanceId from WordpressInstances .

  1. Find corresponding registry_object_id :

    MariaDB [psa]> select * from apsc.aps_application where id=8;
    +----+--------------------+---------------+-------------------+------------+------+
    | id | registry_object_id | master_app_id | package_config_id | package_id | name |
    +----+--------------------+---------------+-------------------+------------+------+
    | 8 | 33 | NULL | 1 | 3 | |
    +----+--------------------+---------------+-------------------+------------+------+
  2. Remove entries from apsc database:

    MariaDB [psa]> delete from apsc.aps_application where id=8;
    MariaDB [psa]> delete from apsc.aps_registry_object where id=33;
    MariaDB [psa]> delete from psa.apsContextsApplications WHERE id=8;

    And from psa database:

    MariaDB [psa]> delete from WordpressInstancesDomains where wordpressInstanceId=7;
    MariaDB [psa]> delete from WordpressInstances where id=7;

If you cannot delete entry with error:

Cannot delete or update a parent row: a foreign key constraint fails (`apsc`.`aps_resource`, CONSTRAINT `FK_aps_resource_aps_application` FOREIGN KEY (`app_id`) REFERENCES `aps_application` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)
  1. Run:

    MariaDB [psa]l> SET FOREIGN_KEY_CHECKS = 0;
  2. Remove required records.

  3. After that run:

    MariaDB [psa]l> SET FOREIGN_KEY_CHECKS = 1;
Have more questions? Submit a request
Please sign in to leave a comment.