BlueHost Custom php.ini file setup

Home Forums BulletProof Security Pro BlueHost Custom php.ini file setup

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #19749
    Joseph Lee
    Participant

    “The P-Security Read Me help buttons list all the setup steps for creating a custom php.ini file.”

    http://forum.ait-pro.com/forums/topic/php-error-log-path-does-not-match/page/3/#post-19747

    Yes, they do, but since I do not yet understand and know exactly where the BPS Pro PHP.ini Options can and/or do actually write and place the related file or files, I need some help with those unknowns-to-me so I can follow the listed steps properly for my own situation.

    Overall, I want to maintain (to keep what I already have in place as) a single /public_html/php.ini file affecting all of my domains at once, and then I am hoping my single installation of BPS Pro at an Add-On Domain in a sub-folder can read-and-write that file which will then continue to also affect all of my other domains at once.

    Here is how my domains and their single php.ini file are arranged and currently called:

    /public_html/.htaccess

    ## BlueHost
    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php
    (truncated here for brevity)
    

    /public_html/php.ini

    /public_html/addon0/.htaccess

    # BULLETPROOF PRO 9.9 SECURE .HTACCESS
    ## /home3/hostaccount/public_html/addon0/wp-content/plugins/(BulletProof Security Pro)
    # CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    AddHandler application/x-httpd-php54s .php
    (truncated here for brevity)
    


    note: All of the following domains are handled the same, as follows…
    /public_html/primary/.htaccess
    /public_html/primary/addon8/.htaccess
    /public_html/addon1/.htaccess
    /public_html/addon2/.htaccess
    /public_html/addon3/.htaccess
    /public_html/addon5/.htaccess
    /public_html/addon5/subdomain7/.htaccess

    # BULLETPROOF .51.4 >>>>>>> SECURE .HTACCESS
    # CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    AddHandler application/x-httpd-php54s .php
    (truncated here for brevity)
    


    BlueHost offers these options concerning PHP and php.ini:

    PHP 5.4
    All files with the extension .php will be handled by the PHP 5.4 engine.

    PHP 5.4 (Single php.ini)
    Same as PHP 5.4, but all subdirectories will use ~/public_html/php.ini

    PHP 5.4 (FastCGI)
    All files with the extension .php will be handled by PHP 5.4 FastCGI processes.

    I have always-and-only-ever used “Single php.ini as default” for all of my domains, and while assuming BPS Pro *might* be able to read and write /public_html/php.ini from its own location elsewhere, I am not presently aware of any need or reason to change away from “Single php.ini as default”.  If I must, however, I can/could switch away from “Single php.ini as default” and have BPS Pro write a secondary php.ini file as /public_html/addon0/php.ini…and then I could manually copy that file to each of the other domains…but I would rather not have to do that.

    So, can BPS Pro read and write /public_html/php.ini from its own location elsewhere at /home3/hostaccount/public_html/addon0/wp-content/plugins/(BulletProof Security Pro)?

    #19751
    AITpro Admin
    Keymaster

    You would only create 1 custom php.ini file in the hosting account root folder.  That 1 custom php.ini file will apply its settings to all of your websites under your Hosting account.  This is the typical custom php.ini setup that you see/is allowed on 99% of all web hosts.  You should probably check with BlueHost to find out why the ini_set error_log path code is not working on your server since if you add the path to the BPS php error log in your 1 custom php.ini file then all of your websites will log php errors to the path that you add in your custom php.ini file.  It is much better to have each site log php errors in their own php error log so check with BlueHost to see why that is not being allowed/not working on your particular server.

    Since you already have an existing custom php.ini file then you would just be adding the directive settings in your existing php.ini file.  Click the Read Me button on the P-Security >>> File Editor page.

    Just an FYI – P-Security has a diagnostic checking tool – Diagnostic Checks/Recommendations Run Check.

    #19763
    Joseph Lee
    Participant

    Where is the “Go” button to actually write to /home3/hostaccount/public_html/php.ini ??  I believe I have that path set in the right places and I have done the 1-2 to save options, but /home3/hostaccount/public_html/php.ini has yet to be changed even though that file has been re-dated.

    #19764
    AITpro Admin
    Keymaster

    You save file paths in the File Manager and the label/description you give for that file / file path will be displayed in the drop down select box for the File Editor.  You would select that file label and click the Select button, which will open the file for editing (if it is editable).  You can open protected Server Files to view them, but you cannot edit them because they are protected Server files.  You will either see a Green or Red font message displayed when you open any file that will tell you if the file is editable or not.  After editing a file that you have opened with the File Editor you would click the Update File button to save your editing changes.

    #19767
    Joseph Lee
    Participant

    Got it!  Doing what you had just posted has definitely changed my all-domains-use-it php.ini file as desired and right where it is.  And now, and since I do still have a bit of red showing, certain other changes must need to be done via manual edits, yes?

    Definitely looking forward to tomorrow…and part of that will be trying to begin addressing the matter of why certain *other* plugins are building my error log as they are…

    Many thanks.

    #19768
    AITpro Admin
    Keymaster

    Not sure what you are saying here – “I do still have a bit of red showing, certain other changes must need to be done via manual edits, yes”.  Are you seeing an error message?  If so, what is the error message?

    For php errors occurring in other plugins and themes take a look at this forum topic as a starting point:  http://forum.ait-pro.com/forums/topic/how-to-troubleshoot-php-errors-php-errors-in-your-php-error-log/

    #19770
    Joseph Lee
    Participant

    Oh no, all is well with BPS, and I was referring mostly to something like this that apparently I must edit manually “by removing the semi-colon…”:

    disable_functions The recommended PHP functions are not disabled. The disable_functions directive is not in use or is commented out in your php.ini file. Uncomment the disable_functions directive by removing the semi-colon from in front of it.

    Hoping that posts okay!

    There are still some reds showing on the Php.ini Security Status page, but I am guessing that is because I am still negotiating my personal learning curve.  Then after I have have taken care of those tomorrow, the errors I had mentioned from the error log are those being caused by other plugins, not by or within BPS.

    #19772
    AITpro Admin
    Keymaster

    Yep, once you add / change all the recommended custom php.ini file settings then the status displays will go from Red to Green.

    Since you already have an existing custom php.ini file then you would just be adding the directive settings in your existing php.ini file.  Click the Read Me button on the P-Security >>> File Editor page.

    #19773
    Joseph Lee
    Participant

    Oops, I was wrong in saying my php.ini file had been changed.  It does show a change of FileSize after doing what I have done so far, but its content is still identical to the BlueHost default.  So, I looked more closely at the BPS error log and discovered these along with some errors from another plugin that had first caught my attention:

    Six of these:
    PHP Warning:  fopen(/home3/hostaccount/public_html/oldfolder/wp-content/bps-backup/backups_SNQXEz8pxsVImGF/.htaccess): failed to open stream: No such file or directory in /home3/hostaccount/public_html/addon1/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 140
    
    These two:
    PHP Warning:  fopen~.htaccess): failed to open stream: No such file or directory in /home3/hostaccount/public_html/addon1/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 140
    PHP Warning:  copy~.htaccess): failed to open stream: Permission denied in /home3/hostaccount/public_html/addon1/wp-content/plugins/bulletproof-security/admin/core/options.php on line 399
    
    Seven pair of these:
    PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in /home3/hostaccount/public_html/addon1/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 141
    PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /home3/hostaccount/public_html/addon1/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 142

    Those first six are likely because “oldfolder” is no longer the name of the folder containing this domain where BPS Pro is installed, and then you can also see that domain actually had two different folder names in that error line.  So, maybe you can tell me the best way to correct that.

    I have no idea as to what might be causing the others, but I am committed here, there is no hurry and I will do whatever it takes to get them straight.

    You had posted: “Since you already have an existing custom php.ini file then you would just be adding the directive settings in your existing php.ini file.  Click the Read Me button on the P-Security >>> File Editor page.”

    I have taken a look there, and my plan at the moment is to copy all the Custom php.ini directives suggested there and apply them to php.ini manually.  So again, there is no hurry here whenever you might have the time and energy to try to help me resolve those errors.

    Many thanks for a truly-great plugin!  BPS Free has *always* impressed me, but I now realize the total BPS package is even greater than the sum of it parts.

    #19777
    AITpro Admin
    Keymaster

    Re-run the Wizards again without uninstalling BPS Pro. That should automatically take care of things.
    If you are still seeing new php errors then uninstall and reinstall BPS Pro and run the Wizards again.

    #19781
    Joseph Lee
    Participant

    Since the path problem to this particular domain goes back in time quite a ways and I do recall having some kind of problem there with whatever else before now, I deactivated BPS Pro and deleted its entire backups folder as well as its four or five (I do not recall) database tables, then re-activated and began going through everything as best I can comprehend it all at the moment.  For me and the way my brain is wired — Asperger Syndrome — there is a lot of mental overload going on here but I go slowly and take plenty of breaks.  The wizards seem to have disappeared altogether, and I cannot get the (disabled) “ARQ FailSafe Procedural Shutdown” alert to display *only* within BPS Pro.  However, my php.ini file is perfectly fine and that was my biggest desire!  I do still have these errors, and the first is still showing the domain’s previous foldername:

    PHP Warning:  fopen(/home3/hostaccount/public_html/oldfolder/wp-content/bps-backup/backups_SNQXEz8pxsVImGF/.htaccess): failed to open stream: No such file or directory in /home3/hostaccount/public_html/domainfolder/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 202
    PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in /home3/hostaccount/public_html/domainfolder/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 203
    PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /home3/hostaccount/public_html/domainfolder/wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 204

    If you might tell me where to look, I think the simplest thing to do there would be to go into the database and fix that.

    Question:
    Is this in /wp-content/uploads/ possibly any part of any problem here:

    <?php
    // in-/wp-content/-n-/plugins/-n-/themes/n-/uploads/
    // Permissions: 0404 //
    exit;?>
    #19784
    AITpro Admin
    Keymaster

    Create a temporary Administrator login to this site so I can see what the issue is.  Send the login to edward at ait-pro dot com.

    #19785
    Joseph Lee
    Participant

    I do manage that site, but that is the one domain in the cluster that I do not own, so I do not have that liberty. All is well there, however, and I will ultimately get it sorted in one way or another! Nothing is broken and BPS is working perfectly other than whatever minor issue there might be going on as evidenced in those couple of php errors.

    #19787
    AITpro Admin
    Keymaster

    Re-running the Wizards should fix any/all problems.  If it doesn’t then you would uninstall, reinstall BPS Pro and run the Wizards.  You could probably do things manually, but that would be fairly complex vs just clicking some buttons.

    See this forum topic for possible causes of the php error:  http://forum.ait-pro.com/forums/topic/cron-error-with-new-db-backup-feature/  Also the php error log is a static plain text file.  php errors are logged by timestamp in descending order.  Older php errors that were previously occurring will still remain in the static text file and newer php errors will be logged below older php errors.

    Is this in /wp-content/uploads/ possibly any part of any problem here:

    I do not recognize that file or code as being a valid WordPress file or code so I cannot give you any kind of answer. I assume/guess it might break things since it is not a standard WordPress file. The BPS Pro Uploads Anti-Exploit Guard (UAEG) .htaccess file protects the uploads folder so I assume whatever that file or code is it is not needed.

    #19804
    Joseph Lee
    Participant

    Okay, and following a re-installation that was definitely *not* the fault of BPS Pro, all is well now with all errors gone and no notices in need of dismissal…and I have again learned from you along the way!  Many thanks.  While bringing a total of eleven (11) domains together at one hosting account over these past few weeks (including re-location of the Primary Domain as well as changing it to an Add-On), I had not thought about BPS’ use of “actual server path” being hobbled by what I was doing.  I was a bit surprised that this re-installation did automatically over-write my existing domain-root .htaccess file and showed none of my BPS Free entries in the .htaccess Custom Code boxes, but restoring all of that from my own backup was no problem at all.

    You had said: The BPS Pro Uploads Anti-Exploit Guard (UAEG) .htaccess file protects the uploads folder so I assume whatever that file or code is it is not needed.

    Understood, and so what about this default /plugins/index.php that comes along as part of WordPress in a different location… After deleting my own version of that to let BPS Pro do its stuff at /uploads/, I have yet to try it there.

    <?php
    // Silence is golden.
Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.