170 posts Amazing WordPress Themes
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has referred 50+ members
  • Has collected 100+ items on Envato Market
+5 more
Code125 says

Hello Guys i have a under-development theme is producing that error on localhost only

Warning: include(PATH_TO_THEME/functions.php): failed to open stream: Permission denied in PATH_TO_WORDPRESS/wp-settings.php on line 316

and nothing is loaded, and this happens only in localhost and nothing where else.

and any other theme is working.

Any idea where can the problem be ?

296 posts
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
crossroad says

Because server does not have permission to read that file?

What’s the PATH_TO_THEME ? Relative path?

170 posts Amazing WordPress Themes
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has referred 50+ members
  • Has collected 100+ items on Envato Market
+5 more
Code125 says

its permission is 640 functions.php “like any other theme”

PATH_TO_THEME is Applications/XAMPP/xamppfiles/htdocs/wp/wp-content/themes/kalemat/functions.php

1316 posts The Last Man Standing
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Sells items exclusively on Envato Market
+7 more
ImanGM says

Hey,

Try 644, if didn’t work, try even 777 and see if this issue is related to your file system permission or not.

If it helped try to fix the webserver configs to run by 644 but if it didn’t help, you can proceed with the next steps…

Cheers,
Iman

170 posts Amazing WordPress Themes
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has referred 50+ members
  • Has collected 100+ items on Envato Market
+5 more
Code125 says

I changed all the php permissions to 644 and it worked

here is the command line i used for anyone who may face such a problem

cd the_theme_path
sudo find . -type f -name '*.php' -exec chmod 644 {} \;

Thanks so much guys for your help :)

by
by
by
by
by
by