Basic php file not working

I created a child domain under my primary website and I am trying to run a simple php file. But is giving me an error message “403 Forbidden Access to this resource on the server is denied!”

I tried, “File Manager → Fix Permissions button” still not working.

I checked error log…and it says the following.
MIME type [application/x-httpd-php] for suffix ‘.php’ does not allow serving as static file, access denied!

Hello @savors.map Happy you are here

Seems like lsphp is not setup you need to tell ols that your default lsphp external application will be serving .php scripts in this virtual host.

Setup script handler for your php by going to LiteSpeed WebAdmin console → Server → Script Handler and point to the right external app (php) Set up OLS with Multi PHP versions – OpenLiteSpeed

How can I do that from the CyberPanel Control panel?

Go to OLS WebAdmin Console of your server i.e https://SERVER_URL:7080 use admin and password you chose for CyberPanel admin panel

If you cannot log in. Using SSH Terminal run adminPass add new password e.g.

adminPass mynewstrongpasswordgoeshere

If that fails for some reason user:

cd /usr/local/lsws/admin/misc
./admpass.sh

Cyberpanel admin password is not working… Is there any other port I need to open other than 7080?

Why didn’t the cyberpanel automatically setup lsphp when I created the website?

Your issue is rare but since cyberpanel is based on litespeed or the opensource openlitespeed depending on what you chose during setup the fix is just that.

Use above commands to generate new password and retry.

your php version?

This command does not work, the password does not set.

How to access this OLS, I did not even know of the existence of this panel. :confused:

cd /usr/local/lsws/admin/misc
./admpass.sh

This should work out of the box

I got the same issue, my main domain it works fine, but sub domain shows

MIME type [application/x-httpd-php] for suffix '.php' does not allow serving as static file, access denied!

image

Already tried this method, both in the Content and in the site htaccess
@usmannasir Do you have any suggestions?
I get this in every error log I can see on every domain.

I think it even has something to do with my subdomain not working as it should.
If the ID at the end is listed in my Database, it turns “true” if false, it should say false.
But here on my subdomain it just returns internal error 500.

Both the main domain and sub domain have the exact same mas folder.
Same files, nothing changed.
Any idea why it can’t load?

Right ID works:
https://mas.newstargeted.com/mas/Bans.php?Bans=43099391

Non ID broken:
https://mas.newstargeted.com/mas/Bans.php?Bans=4309939

Main domain both works:

https://newstargeted.com/mas/Bans.php?Bans=43099391
https://newstargeted.com/mas/Bans.php?Bans=4309939

Has anyone found any solution to the php issue?
My logs still get this error:

MIME type [application/x-httpd-php] for suffix '.php' does not allow serving as static file, access denied!

I see that someone said this for 8.1 on ubuntu, I have AlmaLinux, and not sure if this will be the solution there.

Php 8.1 - Support and Discussion / Web Server - CyberPanel Community

Looks like the PHP suffix not set in WebAdmin console. Login to your WebAdmin (OLS)

console:

→ Server Configuration → Script Handler

add a php suffix and point to the right external app lsphp

This solved for me in a previous problem. :slight_smile:

I did some tests here, and in your case, try this:

uds://tmp/lshttpd/lsphp81-$VH_NAME.sock

This should work

Oh, and important detail, if you use VHost Templates, should apply this on the teamplate a should also add the suffix ‘php’

I think this problem is being common because they are modifying directly on config server :slight_smile:

Blockquote I did some tests here, and in your case, try this:
uds://tmp/lshttpd/lsphp81-$VH_NAME.sock
This should work

This was the solution!
Thank you so much :slight_smile:



Great that you managed to do, I also had a problem like that, so I found the solution. :slight_smile:

It will certainly help many here.