190 posts Amazing WordPress Themes
  • Meetup Participant
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+8 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 ?

313 posts
  • 4 Years of Membership
  • Exclusive Author
crossroad
says

Because server does not have permission to read that file?

What’s the PATH_TO_THEME ? Relative path?

190 posts Amazing WordPress Themes
  • Meetup Participant
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+8 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

1891 posts The Last Man Standing
  • Weekly Top Seller
  • Author Level 8
  • Beta Tester
  • Elite Author
+9 more
ThemeWisdom
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

190 posts Amazing WordPress Themes
  • Meetup Participant
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
+8 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