Apache FastCGI and PHP-FPM Unable to open primary script

I am trying to switch my Apache - PHP setup over to use the Apache event module and PHP-MPM with fastcgi in order to get better performance.
I am running Leap 15.6.
I followed the SDB article: SDB:Apache FastCGI and PHP-FPM configuration - openSUSE Wiki
No problems with starting services. Everything is running, but I cannot use it.
I keep on getting this error:
“AH01071: Got error ‘Unable to open primary script: //srv/www/htdocs/index.php (Permission denied)’”

I have searched the net for answers, but I do not get any answers that work.
I have set the permissions of /srv/www/htdocs/index.php to wwwrun:www (the user and grout that apache and the php-fpm process is running), but that did not resolve the issue.

I disabled AppArmor, does not help.

Any idea how to get it working?

Thanks
AndreT

How exactly did you do it?

Please show the perms of that file
ls -lah /srv/www/htdocs/index.php

I disabled it in YAST and checked that the service is not running

-rw-r–r–+ 1 wwwrun www 22 Nov 17 11:20 /srv/www/htdocs/index.php

Did you reboot after that?

No, did not reboot. Cannot reboot now as server is busy with other things that I don’t want to stop.

Then you did not disable anything. AppArmor is not a service and stopping AppArmor “service” does not do anything. Run

aa-teardown

to actually stop and unload AppArmor.

Ok, thanks will try that

OK, this worked!
Thanks!
SO it was AppArmor.
So I will need to set up AppArmor to allow php-fpm I guess?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.