Home › Forums › BulletProof Security Pro › PHP Warning – Open_basedir
- This topic has 7 replies, 2 voices, and was last updated 2 years, 4 months ago by
AITpro Admin.
-
AuthorPosts
-
Jan
ParticipantHello support,
Can you provide some advice how to resolve these errors?
[20-Mar-2022 16:56:15 UTC] PHP Warning: RecursiveDirectoryIterator::hasChildren(): open_basedir restriction in effect. File(/home//domains//public_html/access-logs) is not within the allowed path(s): (/home//:/tmp/:/var/tmp/:/opt/alt/php74/usr/share/pear/:/dev/urandom:/usr/local/php74/lib/:/usr/local/php74/lib/:/usr/local/php73/lib/:/usr/local/lib/php/) in /home//domains//public_html/wp-content/plugins/bulletproof-security/includes/mscan-ajax-functions.php on line 363 [20-Mar-2022 16:57:13 UTC] PHP Warning: RecursiveDirectoryIterator::hasChildren(): open_basedir restriction in effect. File(/home//domains//public_html/access-logs) is not within the allowed path(s): (/home//:/tmp/:/var/tmp/:/opt/alt/php74/usr/share/pear/:/dev/urandom:/usr/local/php74/lib/:/usr/local/php74/lib/:/usr/local/php73/lib/:/usr/local/lib/php/) in /home//domains//public_html/wp-content/plugins/bulletproof-security/includes/mscan-ajax-functions.php on line 1086
AITpro Admin
Keymasteropen_basedir errors are very straight forward. The error is telling you that this directory: /public_html/access-logs is not included in your allowed paths.
To fix that you would change this php.ini directive setting: open_basedir = add this additional path for this directory at the end of your other paths > /public_html/access-logs
Or just exclude the /public_html/access-logs directory from being scanned by MScan. Your MScan folder exclude rule would be this in the Exclude Individual Folders textarea: /public_html/access-logs/
Jan
ParticipantThank you for explaining these errors and the provided solutions.
Jan
ParticipantHello support,
Even after excluding the folder the php error keeps coming back.
https://drive.google.com/file/d/1GJY2e47oX7pRZzUTTbg9_pLyj9XFs_97/view?usp=sharing
AITpro Admin
KeymasterOk let me test open_basedir and MScan on a Local Dev site. Maybe there is a bug somewhere with the Exclude Individual Folders textarea option. Should able to get to that today or tomorrow.
AITpro Admin
KeymasterI started testing this issue and noticed this problem before creating a simulation with open_basedir > you have double slashes after home and domains. These should be single slashes.
/home//domains//public_html/access-logs
Since your open_basedir directive settings already allow any child folder above: /home/ then you should not have to add an additional folder allow rule for: /home/domains/public_html/access-logs since open_basedir is recursive.
What I think might be happening is that MScan is using correct paths without double slashes // and since your settings are incorrect then that is why the error is occurring. So you will need to fix your open_basedir directive settings so that all paths have single slashes and not double slashes. I should have noticed that before, but I only briefly glanced at the php error.
Also if this is a VPS or Dedicated server then in order for php.ini configuration changes to take affect you need to reboot your server.
Jan
ParticipantThe paths are correct as the double slashes have been created by removing the content.
With some help from my hosting it is resolved. The acces-logs folder was not created, so after doing that the php-error did not occur when performing the scan.
AITpro Admin
KeymasterI don’t logically understand how those things could work, but if they work then great.
-
AuthorPosts
- You must be logged in to reply to this topic.