Migrate from PHP 5.2.9 to PHP 5.6.8

1

I have a warehouse management system done on PHP 5.2.9 every system is running in apache. The files are with .php5 extension, how can I migrate this system in order to decrease the impact on the whole system? As well as changing the .php5 extension to .php ??

    
asked by anonymous 28.04.2015 / 17:11

1 answer

2

The extension php5 is customized, in other words it has nothing to do with the php version, since in Apache (I suppose this can be your server) you can use the extension you want.

What you'll probably have to do is:

  • Edit all links and form files that use the .php5 extension first, open them all in an editor like sublimetext3 and press Ctrl + Shift + F

  • Replace .php5 with .php and after saving them rename a file by one.

  • Apache

    If you want to keep the .php5 extension, you can upgrade your apache and php and then edit Apache's httpd.conf and add the .php5 extension and add something like this:

    <IfModule mime_module>
        AddType application/x-httpd-php .php5
    </IfModule>
    

    Nginx

    If your server is Nginx, you can edit the file nginx.conf , as in the example (it's just an example, be careful editing):

    location ~ [^/]\.php(|5)(/|$) {
        fastcgi_split_path_info ^(.+?\.php(|5))(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }
    
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
    }
    

    Lighttpd

    In lighttpd edit the file lighttpd.conf first and look for a line similar to this:

    static-file.exclude-extensions = ( ".php", ".pl", ".cgi" )
    

    Change to:

    static-file.exclude-extensions = ( ".php5", ".php", ".pl", ".cgi" )
    

    Then look for the line that looks like fastcgi.server = ( and fastcgi.map-extensions = ( , should look something like:

    fastcgi.server             = ( ".php" =>
                                   ( "localhost" =>
                                     (
                                       "host" => "127.0.0.1",
                                       "port" => 9000
                                     )
                                   )
                                 )
    
    ## map multiple extensions to the same fastcgi server
    fastcgi.map-extensions     = ( ".php5" => ".php" )
    
        
    28.04.2015 / 17:26