• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

PHP pathing issues / include errors

OurAce.com

New Pleskian
The Below is from a generic install from the Application installer. Had I put this under httpdocs\subdomains there would be no issue. Notice the path is out side the httpdocs folder

Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in D:\InetPub\vhosts\win.weeatupthecompetition.com\subdomains\wordpress\index.php on line 17

Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='/') in D:\InetPub\vhosts\win.weeatupthecompetition.com\subdomains\wordpress\index.php on line 17

(could be Joomla, Drupal, any PHP site that use includes. So basically all of them)



You shouldn't need to modify any include paths for PHP, I have done this my self, always thinking it was a php.ini issue. This is not the case.
You only need to make 1 permissions change: Add server\IUSR_someaccount with : "List folder contents" to the directory that is outside of httpdocs. in this case subdomains

I went into Plesk afterwards and went to the domain and added then removed "Additional write/modify permission" to see if it would remove my IUSR that I added. It will not be removed via the web interface through editing the domain.


Technical Notes: Why does this happen; when the windows php-cgi.exe can not getcwd it reverts the current directory to where ever the cgi-php.exe is running in, because it has access to this path it will set the plesk\addtional directory as the current working directory (php-cgi.exe runs under the perms of the iusr). A simple way to test is to create a php file in the directory your having issues with: then hit that page with a browser
PHP Page:

<?php
echo getcwd();
?>

This should show the full path to the directory you ran the script in. If it shows: C:\Program Files (x86)\Parallels\Plesk\Additional\[plesk version folder]
Then this is your issue and you can add the IUSR to the root folder with "list folder content"


Retrieved from: http://ourace.com/blog/95-plesk-php-include-paths-break
 
Back
Top