167 posts Amazing WordPress Themes
  • Elite Author
  • Most Wanted Bounty Winner
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Egypt
  • Author had a Free File of the Month
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
  • Exclusive Author
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 ?

292 posts
  • Exclusive Author
  • Has been a member for 2-3 years
crossroad says

Because server does not have permission to read that file?

What’s the PATH_TO_THEME ? Relative path?

167 posts Amazing WordPress Themes
  • Elite Author
  • Most Wanted Bounty Winner
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Egypt
  • Author had a Free File of the Month
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
  • Exclusive Author
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

1112 posts The Last Man Standing
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Exclusive Author
  • Bought between 10 and 49 items
  • Sold between 50 000 and 100 000 dollars
  • Beta Tester
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

167 posts Amazing WordPress Themes
  • Elite Author
  • Most Wanted Bounty Winner
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Egypt
  • Author had a Free File of the Month
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
  • Exclusive Author
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