Title: is_dir() error open_basedir restriction
Last modified: August 18, 2022

---

# is_dir() error open_basedir restriction

 *  [adolfomayoral](https://wordpress.org/support/users/adolfomayoral/)
 * (@adolfomayoral)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/is_dir-error-open_basedir-restriction/)
 * Warning: is_dir(): open_basedir restriction in effect. File(/plugin-templates/
   login-with-ajax/) is not within the allowed path(s): (/var/www/vhosts/iberdomotica.
   com/:/tmp/) in /var/www/vhosts/iberdomotica.com/httpdocs/wp-content/plugins/login-
   with-ajax/login-with-ajax.php on line 693
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fis_dir-error-open_basedir-restriction%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [akalwp](https://wordpress.org/support/users/akalwp/)
 * (@akalwp)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/is_dir-error-open_basedir-restriction/#post-16067959)
 * If you are on Plesk, check this =>
    [https://support.plesk.com/hc/en-us/articles/115000278993-A-website-hosted-in-Plesk-is-not-accessible-open-basedir-restriction-in-effect-File-is-not-within-the-allowed-path-s-](https://support.plesk.com/hc/en-us/articles/115000278993-A-website-hosted-in-Plesk-is-not-accessible-open-basedir-restriction-in-effect-File-is-not-within-the-allowed-path-s-)
 *  [Patrick Baldwin](https://wordpress.org/support/users/patrelentlesstechnologycom/)
 * (@patrelentlesstechnologycom)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/is_dir-error-open_basedir-restriction/#post-16072561)
 * I had this issue as well. It’s making an absolute mess of the PHP error logs.
 * The issue is that the 2nd parameter passed to path_join is an absolute value 
   and so the path is never actually being joined onto WP_CONTENT_DIR. Calling is_dir
   on the absolute path: “/plugin-templates/login-with-ajax” is resulting in the
   warning because on many hosting providers that path will be outside of the webroot.
 * Current code on line 693: `$wp_content_folder = path_join( WP_CONTENT_DIR , "/
   plugin-templates/login-with-ajax/");`
 * Should be: `$wp_content_folder = path_join( WP_CONTENT_DIR , "plugin-templates/
   login-with-ajax/");`
 * The only change is removing the leading slash in the 2nd parameter.
 * I fixed this manually on our site, but would love to see this included in a patch
   version so a plugin update won’t clobber our logs again.
    -  This reply was modified 3 years, 8 months ago by [Patrick Baldwin](https://wordpress.org/support/users/patrelentlesstechnologycom/).
 *  [JohnRDOrazio](https://wordpress.org/support/users/lwangaman/)
 * (@lwangaman)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/is_dir-error-open_basedir-restriction/#post-16161111)
 * I can confirm [@patrelentlesstechnologycom](https://wordpress.org/support/users/patrelentlesstechnologycom/)‘
   s assessment of the problem: adding an initial slash to **/plugin-templates/login-
   with-ajax/** has the effect that the **path_join** function sees it as an absolute
   path.
 * Since the WP constant does not include a trailing slash, you would want to use
   an initial slash if directly joining the WP constant and the trailing portion
   of the path, like this:
 * `$wp_content_folder = WP_CONTENT_DIR . "/plugin-templates/login-with-ajax/";`
 * However, if using the **path_join** function, the initial slash must NOT be present:
 * `$wp_content_folder = path_join( WP_CONTENT_DIR , "plugin-templates/login-with-
   ajax/");`
 * I also applied a manual fix to avoid errors popping up. Please fix!
 *  [andreacomplus](https://wordpress.org/support/users/andreacomplus/)
 * (@andreacomplus)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/is_dir-error-open_basedir-restriction/#post-16345647)
 * I can confirm that this bug is still relevant, please check the proposed solutions!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘is_dir() error open_basedir restriction’ is closed to new replies.

 * ![](https://ps.w.org/login-with-ajax/assets/icon-256x256.png?rev=976165)
 * [Login With Ajax - Fast Logins, 2FA, Redirects](https://wordpress.org/plugins/login-with-ajax/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/login-with-ajax/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/login-with-ajax/)
 * [Active Topics](https://wordpress.org/support/plugin/login-with-ajax/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/login-with-ajax/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/login-with-ajax/reviews/)

 * 4 replies
 * 5 participants
 * Last reply from: [andreacomplus](https://wordpress.org/support/users/andreacomplus/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/is_dir-error-open_basedir-restriction/#post-16345647)
 * Status: not resolved