Migrate from PHP 5.2.9 to PHP 5.6.8

Asked

Viewed 545 times

1

I have a warehouse management system made over PHP 5.2.9 all the system is running in apache. The files are with extension . php5, how can I migrate this system to decrease the impact on the whole system ? as well as change the extension . php5 to . php ??

  • The php5 extension is customized, you will probably have to edit all the links and form files that use the extension. php5 first, opening them (all) in an editor as sublimetext and pressing Ctrl+Shift+F and replacing . php5 by . php and after saving them rename a file by one. I really don’t understand the tag princípios-de-programação in the question, the question seems to me only migration.

  • In addition to the Apache part, a lot of things needed to be changed in the code. A lot has been discontinued between the PHP 5.2 to 5.6.

1 answer

2


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

What you’ll probably have to do is:

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

  2. Substitute .php5 for .php and after saving them rename a file by a.

Apache

If you want to keep the extension .php5, you can upgrade your apache and php and then edit Apache httpd.conf and add the extension .php5 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 is just an example, beware when 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 first lighttpd.conf and look for a line similar to is:

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

Change to:

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

and then look for the line that resembles 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" )

Browser other questions tagged

You are not signed in. Login or sign up in order to post.