Shared PHP folder all of a sudden prompting to download

Clint Decker

Member
Oct 15, 2014
15
0
1
Saratoga Springs, Utah, United States
cPanel Access Level
Root Administrator
I have a shared php directory where I stick some php files that I use on multiple sites (like a captcha image, html editor, etc).

I have an Alias folder setup in my httpd.conf file like this:

Alias /sys-images/ /home/****/shared-scripts/images/

Then, on any site, I can access images and scripts by doing this:

one_of_my_sites.com/sys-images/myimage.jpg

Or...

one_of_my_sites.com/sys-images/captcha.php

All of a sudden, I think last night, or over the past couple days... any access to php files stopped working. (the images still work) It started prompting to download the file instead of executing it. I dont know what changed, but a whole bunch of stuff on the server doesnt work now.

I changed the PHP 5 Handler from dso to suphp (since all my other servers are configured that way) and it didnt help.. now instead of prompting to download, it just gives an Error 500 premature script headers error.

Does anyone know how I can fix this?
 

Clint Decker

Member
Oct 15, 2014
15
0
1
Saratoga Springs, Utah, United States
cPanel Access Level
Root Administrator
I changed it back to dso and the captcha image is working, but if I try to access a php file in the shared folder, its prompting the php file download. If I open it, you can see all the php code. This wasnt happening a week ago.

Hoping someone has a suggestion soon, this is bad since people can now download my php files. :(
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello,

I am happy to see you were able to resolve the issue. Note that you may want to consider uploading a copy of those files to each account instead of sharing a directory, as sharing a directory is not always the most secure method of accessing files.

Thank you.
 

Clint Decker

Member
Oct 15, 2014
15
0
1
Saratoga Springs, Utah, United States
cPanel Access Level
Root Administrator
So this problem keeps happening over and over. Randomly, a new .htaccess file is automatically created and it sticks this contents in the file:

<IfModule mod_php4.c>
php_value engine off
</IfModule>
<IfModule mod_php5.c>
php_value engine off
</IfModule>


I dont know how its being created or why it keeps appearing. Any ideas?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

Thank you.