Custom php.ini htaccess handler

Home Forums BulletProof Security Free Custom php.ini htaccess handler

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #17661


    I have added the path to the custom php.ini in the correct section of my htaccess file using the custom code option in the plugin and I have activated it so I can see the resulting file on the sever when I look via FTP.

    I see..

    # If you are using a PHP Handler add your web hosts PHP Handler below
    SetEnv PHPRC /home/aditerum/public_html/php.ini

    The reason I have a custom php.ini is to allow the use of fsockopen and escapeshellarg but I am also trying to configure Wanguard. And at the moment Wanguard continues to tell me that network functions are disabled….”Your web host or server administrator has disabled PHP’s fsockopen or gethostbynamel functions.” but my custom php.ini correctly enables fsockopen but something … somewhere … is stopping the custom php.ini from being seen and used so I assume it is something in the htaccess but I can’t find anything that sticks out like a sore thumb.

    Prior to using BPS my Wanguard configuration was working, so my original (albeit feeble) htaccess file was allowing my custom php.ini to be seen/used. So there must be something I have missed or done incorrectly that is stopping this….but what?

    Any pointers?

    AITpro Admin

    You would need to check your web host help pages or contact your web host to find out which php/php.ini handlers to use for your host server.  Custom php.ini files are not a one size fits all thing and is a unique / specific thing to each web host and each web host server.  This forum topic link below will get you started in the right direction.  Disregard any references to BPS Pro custom php.ini setup.


    I don’t have an issue or problem with the content of my php.ini because the custom php.ini was created by the host engineers for me and has been in use for over a year. It is only since I installed BPS that it is no longer being used. So I am guessing that even though I have added the line of custom code into the htaccess file via BPS that somewhere there is another setting in BPS that is overriding the use of the custom php.ini?

    AITpro Admin

    Nope that is not possible.  If you add the “correct” php.ini handler for your particular server then that is what the server will be directed to use.  BPS does not do anything else with php/php.ini handlers or php.ini files.  This is a static setting that you add to your .htaccess file with static htaccess code.  The php/php.ini handler htaccess code is either correct for your server or it is incorrect.  Your php.ini file settings are either correct or incorrect or not allowed on your particular server.  There are no other factors involved in this equation.

    Note:  Since a php.ini file is a server configuration file then you need to kill/restart your web services or reboot your server any time you make server configuration changes so that those new changes/settings will be “seen/loaded” on the server.

    Note:  The host server may or may not allow you to change some server configuration settings.  In other words, if your server does not allow you to change a particular setting then the server will ignore whatever setting you use in a php.ini file.  Only your host would be able to tell you whether they allow or do not allow you to change something on your/their server.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.