PHP server version change procedural steps with BPS Pro

Home Forums BulletProof Security Pro PHP server version change procedural steps with BPS Pro

Viewing 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • #36001
    AbZu2
    Participant

    After a very lengthy process I was able to update my PHP version to 7.0. It has now reverted back to 5.4.46. Reluctant to repeat the whole scenario again until I can determine the file responsible for this situation. My current file structure is:

    
    public_html >> .htaccess
    # CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php
    
    public_html >> wp-content >> bps-backup >> autorestore >> root-files > .htaccess
    # Use PHP70CGI as default
    AddHandler fcgid70-script .php
    
    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess
    # BULLETPROOF PRO 13.6 SECURE .HTACCESS
    # CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php
    
    

    I wonder if changing the line in:

    public_html >> .htaccess

    and

    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess

    from:

    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php

    to:

    # Use PHP70CGI as default
    AddHandler fcgid70-script .php

    would solve the problem.

    Reluctant at the moment to update to PHP 7.0 on my host until I find out what is going on.

    #36002
    AITpro Admin
    Keymaster

    Yep, you should only need to delete the PHP 5.4 handler htaccess code from BPS Custom Code, save your changes and activate root folder BulletProof Mode.

    Interesting that your server/website did not crash again.  That means that your server only crashes if it does not find the PHP handler htaccess code in the root htaccess file and not when different PHP version handler htaccess code exists in the root htaccess file.  That is still a mistake made by your web host since a server should never crash due to missing php handler htaccess code.

    #36009
    AbZu2
    Participant

    What I had done was delete:

    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess

    made a copy of:

    public_html >> .htaccess

    and renamed it:

    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess

    I feel I am missing something

    •  “.htaccess file that is backed up here”, where is “here” ?
    • is it public_html >> .htaccess or public_html >> wp-content >> bps-backup >> autorestore >> root-files > .htaccess that should be renamed to auto .htaccess in public_html >> wp-content >> bps-backup >> autorestore >> root-files >
    • should PHP be on the host be updated before making any manual changes to the .htaccess file
    #36010
    AITpro Admin
    Keymaster

    You do not need to do all of those other steps.  You should only need to delete the PHP 5.4 handler htaccess code from BPS Custom Code, save your changes and activate root folder BulletProof Mode.

    Normally on a web host server that is configured correctly and does not crash like your server does when changing PHP server versions you would do these steps below:

    1. Turn AutoRestore Off.
    2. Unlock your Root htaccess file on the B-Core > htaccess File Editor page and turn Off AutoLock.
    3. Change your PHP sever version in your web host control panel.
    4. Check your Root htaccess file code/contents to see if your particular web host adds php/php.ini htaccess code at the top of your Root htaccess file.  If you see new php/php.ini htaccess code at the top of your Root htaccess file then copy it to this BPS Root Custom Code text box:  1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE, click the Save Root Custom Code button and click the Root folder BulletProof Mode Activate button.  If you do not see any new php/php.ini htaccess code at the top of your Root htaccess file then you do not need to do anything else and can go to step #5.
    5. Lock your Root htaccess file and turn AutoLock back On on the htaccess File Editor page.
    6. Go to the BPS Pro Setup Wizard page and run the Pre-Installation Wizard and Setup Wizard.

    #36012
    AbZu2
    Participant

    “I am referring to your root .htaccess file that is backed up here

    Could you please so kind as to specify the location of “here

    TIA

    #36013
    AITpro Admin
    Keymaster

    I am referring to your root .htaccess file that is backed up here and renamed to > /bps-backup/autorestore/root-files/auto_.htaccess.

    #36014
    AbZu2
    Participant

    Hmmm “HERE”

    Going to try again going through the steps outlined in this thread 1-6. I think I have found out where the main problem is that causes the PHP to revert to PHP 5.4 after having been updated to PHP  7.0 on the host. The current .htaccess custom code is:

    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php
    
    # BEGIN WEBSITE SPEED BOOST
    # Time cheat sheet in seconds
    # A86400 = 1 day
    # A172800 = 2 days
    # A2419200 = 1 month
    # A4838400 = 2 months
    # A29030400 = 1 year
    
    # Test which ETag setting works best on your Host/Server/Website
    # with Firefox Firebug, Firephp and Yslow benchmark tests.
    
    # Create the ETag (entity tag) response header field
    # This is probably not the optimum choice to use.
    #FileETag MTime Size
    
    # Remove the ETag (entity tag) response header field
    # This is most likely the optimum choice to use.
    Header unset ETag
    FileETag none
    
    <IfModule mod_expires.c>
    ExpiresActive on
    # ExpiresByType overrides the ExpiresDefault...
    # cache expiration time of 2 days|A172800.
    ExpiresDefault A172800
    ExpiresByType image/jpg A4838400
    ExpiresByType image/jpeg A4838400
    ExpiresByType image/gif A4838400
    ExpiresByType image/png A4838400
    ExpiresByType image/bmp A4838400
    ExpiresByType image/x-icon A4838400
    ExpiresByType image/svg+xml A4838400
    ExpiresByType text/javascript A4838400
    ExpiresByType text/x-javascript A4838400
    ExpiresByType text/css A4838400
    ExpiresByType text/html A4838400
    ExpiresByType application/x-font-ttf A4838400
    ExpiresByType application/x-font-woff A4838400
    ExpiresByType font/opentype A4838400
    ExpiresByType application/x-shockwave-flash A4838400
    ExpiresByType application/x-javascript A4838400
    ExpiresByType application/javascript A4838400
    ExpiresByType video/mp4 A4838400
    ExpiresByType video/ogg A4838400
    ExpiresByType video/webm A4838400
    </IfModule>
    
    <IfModule mod_headers.c>
    <FilesMatch "\.(js|css|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png|swf|webm)$">
    Header append Cache-Control "public"
    </FilesMatch>
    <FilesMatch "\.(txt|html)$">
    Header append Cache-Control "proxy-revalidate"
    </FilesMatch>
    <FilesMatch "\.(php|cgi|pl|htm|xml)$">
    Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
    Header set Pragma "no-cache"
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css text/javascript
    AddOutputFilterByType DEFLATE application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/xml-dtd
    AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf
    AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    
    # Drop problematic browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    # END WEBSITE SPEED BOOST
    
    # BEGIN ENDURANCE PAGE CACHE
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^/wp-content/endurance-page-cache/ - [L]
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP_COOKIE} !(wordpress_test_cookie|comment_author|wp\-postpass|wordpress_logged_in|wptouch_switch_toggle|wp_woocommerce_session_) [NC]
    RewriteCond %{DOCUMENT_ROOT}/wp-content/endurance-page-cache/$1/_index.html -f
    RewriteRule ^(.*)$ /wp-content/endurance-page-cache/$1/_index.html [L]
    </IfModule>
    # END ENDURANCE PAGE CACHE
    
    

    QUESTION 1

    After having gone through steps 1-6 can I simply replace the line that is currently in the custom code:

    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php

    with:

    # Use PHP70CGI as default
    AddHandler fcgid70-script .php

    leaving everything else as it is ?

    QUESTION 2

    Can I make the aforementioned change after step 2 ?

     

    #36015
    AITpro Admin
    Keymaster

    Yep, that is correct.  If you want your PHP server to load PHP 7 then use PHP 7 php/php.ini handler htaccess code.  I assume you have already changed your PHP server version to 7 in your web host control panel.  So all that is left to do is to add the PHP 7 php/php.ini handler htaccess code in BPS Custom Code.

    #36016
    AbZu2
    Participant

    In BPS custom code, changed, after Step 2

    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php

    with:

    # Use PHP70CGI as default
    AddHandler fcgid70-script .php

    After updating to PHP 7.0 on my host, I checked the contents of .htaccess and auto_.htaccess which is still

    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess

    # BULLETPROOF PRO 13.6 SECURE .HTACCESS
    # CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php

    Can I simply delete the contents of that file and replace it with the contents of:
    public_html >> .htaccess

    # Use PHP70CGI as default
    AddHandler fcgid70-script .php
    # BULLETPROOF PRO 13.6 SECURE .HTACCESS

    that has the correct updated PHP handler ?

    #36017
    AITpro Admin
    Keymaster

    You just need to complete the standard BPS Custom Code steps:

    1. Add your custom code to BPS Custom Code.
    2. Click the Save Root Custom Code button.
    3. Go to the Security Modes page and click the Root folder BulletProof Mode Activate button.

    That’s it.  There is nothing more you need to do.

    #36018
    AbZu2
    Participant

    Finally managed to update to PHP 7.0 . What an ordeal.

    #36019
    AITpro Admin
    Keymaster

    Yep, not normal at all. You may want to be the nice guy and push the issue with your web host to fix their screwed up server configuration so that next person does not have to go through this unnecessary ordeal. 😉

    #36023
    AbZu2
    Participant

    I will try to explain the situation to my host but I still think that the main problem that I had may have been that I did not manually change the PHP handler code in the BPS custom code. After all the scenarios

    CONCLUSION: THE PHP HANDLER INFO MUST BE IN:
    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess
    AND
    BPS Pro>>B-CORE~Htaccess Core Security>>Custom Code>>Root htaccess File Custom Code>>
    1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE:

    After having updated to PHP 7.0 on my host, I checked:

    public_html >> wp-content >> bps-backup >> autorestore >> root-files >auto .htaccess
    # BULLETPROOF PRO 13.6 SECURE .HTACCESS
    # CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    # Use PHP5.4 Single php.ini as default
    AddHandler application/x-httpd-php54s .php

    … which I changed by deleting that information and replacing it with the .htaccess information that contained the correct PHP handler in:

    public_html >> .htaccess
    # Use PHP70CGI as default
    AddHandler fcgid70-script .php
    # BULLETPROOF PRO 13.6 SECURE .HTACCESS

    Made the changes after step 2 of the posted PHP update procedures.

     

Viewing 13 posts - 16 through 28 (of 28 total)
  • You must be logged in to reply to this topic.