Jump to content

override php.ini config. on a shared server?


rushy
 Share

Recommended Posts

Has anyone come across a shared server where the PHP function ini_set is disabled for security reasons? It seems to break PW correct operation and generate a large error_log. I keep getting guided toward adding lines into the vhost  .htaccess  but what exactly I should add is unclear. (I tried "php_flag php_admin_value  on"  and  "php_flag php_admin_flag   on"  to no effect.) As far as I can see I do not have permission to change the php.ini.

Anyway if anyone has solved this problem for PW sites on shared server I would be grateful of some help!

More info for those that have time to read all about my investigations -

I ran into the problem when I copied a site over to a clients shared server. The problem doesn't occur on my localhost or my own shared server, so I know it must be a config. problem on the clients host.  

The problem seems specific to text fields associated with images within repeaters. I have a repeater defined containing an image and if I change text in the description field and hit save - the text is not saved and original text reappears. This works fine on my local host and my shared host  so I guess it something particular to the PHP config on my clients host.

I have noticed on the client server there is an error_log in the public_html folder.  It contained hundreds of the same error message - namely -

[01-Nov-2018 13:49:42 Europe/Berlin] PHP Warning:  ini_set() has been disabled for security reasons in /home/rushy/public_html/wire/core/ProcessWire.php on line 190

I don't see this error on the other servers, so guessing this is may an indication of the problem, I decided to try and find out how to re-enable ini_set on a shared server. There is quite a lot out there about this, but I've not found out a way so far. 

Thanks - Paul

Link to comment
Share on other sites

Since every hosting company can basically configure their servers as they wish, it would be wise to ask them directly.

On some hosting environments, you can add PHP/Apache customization via control panel, on others you have to add a user.ini file in your site's root directory. With others you have to use .htaccess. But which methods are allowed or not, can surely be answered by their tech support team.

  • Like 4
Link to comment
Share on other sites

On 11/1/2018 at 5:10 PM, dragan said:

Since every hosting company can basically configure their servers as they wish, it would be wise to ask them directly.

On some hosting environments, you can add PHP/Apache customization via control panel, on others you have to add a user.ini file in your site's root directory. With others you have to use .htaccess. But which methods are allowed or not, can surely be answered by their tech support team.

Thanks dragan. I have contacted the host support and they have changed the PHP config. to allow ini_set.  The error in the error_log has now gone.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...