Old:PHP Downgrade from 5.2.3 to 4.4.8: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
(New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| | MPG UniCenter || '''PHP Downgrade from 5.2.3 to 4.4.8''' |} </d...)
 
(Fix grammatical stuff)
Line 12: Line 12:
'''Uniform Server 3.5-Apollo.'''
'''Uniform Server 3.5-Apollo.'''
|}
|}
Only reason for downgrading is to match your service provider's version of PHP
The '''only''' reason for downgrading is to match your service provider's version of PHP.


== A) Download PHP 4.4.8 ==
== A) Download PHP 4.4.8 ==
Download full version of PHP 4.4.8
Download the full version of PHP 4.4.8


# Create a new folder named '''c:\php448''' (alternatively save the file to any folder)
# Create a new folder named '''c:\php448''' (alternatively save the file to any folder)
Line 23: Line 23:
:# Download this file: '''PHP 4.4.8 zip package''' [8,434Kb] - 12 Feb 2008<br>md5: 09ffff4b1a54bbadb8fee6acd85a2c1f
:# Download this file: '''PHP 4.4.8 zip package''' [8,434Kb] - 12 Feb 2008<br>md5: 09ffff4b1a54bbadb8fee6acd85a2c1f
# '''Right click''' on file and select '''Extract All''', click '''NEXT''' (no need to change path), click '''NEXT''' again.
# '''Right click''' on file and select '''Extract All''', click '''NEXT''' (no need to change path), click '''NEXT''' again.
'''''[[#top | Top]]'''''


== B) Install ==
== B) Install ==
Start with a clean version of Uniform Server 3.5-Apollo and instal PHP 4.4.8 as follows:
Start with a clean version of Uniform Server 3.5-Apollo and install PHP 4.4.8 as follows:


# '''Extract a new copy of Uniform Server''' to C drive (alternatively you can use any folder or drive)
# '''Extract a new copy of Uniform Server''' to C drive (alternatively you can use any folder or drive)
Line 44: Line 42:
<li> '''Restore php.ini''': Copy php.ini from C:\Uniform Server to C:\Uniform Server\udrive\usr\local\phpSave the file to any folder.
<li> '''Restore php.ini''': Copy php.ini from C:\Uniform Server to C:\Uniform Server\udrive\usr\local\phpSave the file to any folder.
</ol>
</ol>
'''''[[#top | Top]]'''''


== C) Edit php.ini ==
== C) Edit php.ini ==
Using a text editor open''' php.ini''' located in folder C:\Uniform Server\udrive\usr\local\php and change the following:
Using a text editor, open''' php.ini''' located in folder C:\Uniform Server\udrive\usr\local\php and change the following:


# Locate the line: ''';extension=php_iconv.dll''' and change to  '''extension=php_iconv.dll'''
# Locate the line: ''';extension=php_iconv.dll''' and change to  '''extension=php_iconv.dll'''
Line 54: Line 51:
# Locate the line: '''extension=php_pdo.dll''' and change to      ''';extension=php_pdo.dll'''
# Locate the line: '''extension=php_pdo.dll''' and change to      ''';extension=php_pdo.dll'''
# Locate the line: '''extension=php_sqlite.dll''' and change to  ''';extension=php_sqlite.dll'''
# Locate the line: '''extension=php_sqlite.dll''' and change to  ''';extension=php_sqlite.dll'''
'''''[[#top | Top]]'''''


== D) Edit httpd.conf ==
== D) Edit httpd.conf ==
Open '''httpd.conf''' located in folder:C:\Uniform Server\udrive\usr\local\apache2\conf
Open '''httpd.conf''' located in folder C:\Uniform Server\udrive\usr\local\apache2\conf


<pre>
<pre>
Line 64: Line 59:
Change to:      LoadModule php4_module "/usr/local/php/php4apache2.dll"
Change to:      LoadModule php4_module "/usr/local/php/php4apache2.dll"
</pre>
</pre>
'''''[[#top | Top]]'''''


== E) Edit phpMyAdmin ==
== E) Edit phpMyAdmin ==
Line 74: Line 67:
  Change to:      $cfg['Servers'][$i]['extension'] = 'mysql';
  Change to:      $cfg['Servers'][$i]['extension'] = 'mysql';
</pre>
</pre>
'''''[[#top | Top]]'''''


== F) Edit my-small ==
== F) Edit my-small ==
Line 85: Line 77:
   old_passwords=1
   old_passwords=1
</pre>
</pre>
'''''[[#top | Top]]'''''


== G) Test - Expected error ==
== G) Test - Expected error ==
Restart the servers, from apanel click on '''phpinfo()''' and check that PHP 4.4.8 info is displayed.
Restart the servers. From apanel click on '''phpinfo()''' and check that PHP 4.4.8 info is displayed.


Now click '''phpMyAdmin''' (left menu) the following error is expected:
Now click '''phpMyAdmin''' (left menu) the following error is expected:
Line 98: Line 88:
'''Reason''':
'''Reason''':


PHP4 uses short password hashes as opposed to PHP5’s long one’s. Anyway it shows PHP4 is working and phpMyAdmin.
PHP4 uses short password hashes as opposed to PHP5’s long ones. Anyway it shows PHP4 is working and phpMyAdmin.


To correct the above '''do not turn the servers off''' and follow these instructions:
To correct the above '''do not turn the servers off''' and follow these instructions:

Revision as of 00:57, 10 February 2010

MPG UniCenter

PHP Downgrade from 5.2.3 to 4.4.8

Uniform Server 3.5-Apollo.

The only reason for downgrading is to match your service provider's version of PHP.

A) Download PHP 4.4.8

Download the full version of PHP 4.4.8

  1. Create a new folder named c:\php448 (alternatively save the file to any folder)
  2. Download and save the following file into the above folder:
  1. Goto: PHP Downloads
  2. Scroll down the page to: Windows Binaries
  3. Download this file: PHP 4.4.8 zip package [8,434Kb] - 12 Feb 2008
    md5: 09ffff4b1a54bbadb8fee6acd85a2c1f
  1. Right click on file and select Extract All, click NEXT (no need to change path), click NEXT again.

B) Install

Start with a clean version of Uniform Server 3.5-Apollo and install PHP 4.4.8 as follows:

  1. Extract a new copy of Uniform Server to C drive (alternatively you can use any folder or drive)
  2. Start and stop the servers. Make sure they work and train any security software.
  3. Backup php.ini:
  1. Copy php.ini from C:\Uniform Server\udrive\usr\local\php to C:\Uniform Server
  1. Install PHP 4.4.8:
  1. Delete the contents of folder C:\Uniform Server\udrive\usr\local\php
  2. Copy the contents of folder C:\php448\php-4.4.8-Win32\php-4.4.8-Win32
    To folder: C:\Uniform Server\udrive\usr\local\php
  3. Copy php4apache2.dll from: C:\Uniform Server\udrive\usr\local\php\sapi
    To folder: C:\Uniform Server\udrive\usr\local\php
  4. Copy iconv.dll from: C:\Uniform Server\udrive\usr\local\php\dlls
    To folder: C:\Uniform Server\udrive\usr\local\php
  5. Copy libmysql.dll from: C:\Uniform Server\udrive\usr\local\php\dlls
    To folder: C:\Uniform Server\udrive\usr\local\php
  1. Restore php.ini: Copy php.ini from C:\Uniform Server to C:\Uniform Server\udrive\usr\local\phpSave the file to any folder.

C) Edit php.ini

Using a text editor, open php.ini located in folder C:\Uniform Server\udrive\usr\local\php and change the following:

  1. Locate the line: ;extension=php_iconv.dll and change to extension=php_iconv.dll
  2. Locate the line: extension=php_mysql.dll and change to ;extension=php_mysql.dll
  3. Locate the line: extension=php_mysqli.dll and change to ;extension=php_mysqli.dll
  4. Locate the line: extension=php_pdo.dll and change to ;extension=php_pdo.dll
  5. Locate the line: extension=php_sqlite.dll and change to ;extension=php_sqlite.dll

D) Edit httpd.conf

Open httpd.conf located in folder C:\Uniform Server\udrive\usr\local\apache2\conf

Locate the line: LoadModule php5_module "/usr/local/php/php5apache2.dll"
Change to:       LoadModule php4_module "/usr/local/php/php4apache2.dll"

E) Edit phpMyAdmin

Edit the phpMyAdmin file: config.inc.php located in folder: C:\Uniform Server\udrive\home\admin\www\phpMyAdmin

 Locate the line: $cfg['Servers'][$i]['extension'] = 'mysqli';
 Change to:       $cfg['Servers'][$i]['extension'] = 'mysql';

F) Edit my-small

Edit my-small Located in folder: C:\Uniform Server\udrive\usr\local\mysql\bin

  Under this line port=3306 add the following two new lines:

  #Use old password encryption method (needed for 4.0 and older clients).
  old_passwords=1

G) Test - Expected error

Restart the servers. From apanel click on phpinfo() and check that PHP 4.4.8 info is displayed.

Now click phpMyAdmin (left menu) the following error is expected:

#1251 - mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client”

Reason:

PHP4 uses short password hashes as opposed to PHP5’s long ones. Anyway it shows PHP4 is working and phpMyAdmin.

To correct the above do not turn the servers off and follow these instructions:

  1. Open a command prompt (start > run > type cmd and press OK)
  2. Type the following and press return at the end of every line:
     W:
     Cd usr\local\mysql\bin
     mysql -u root –p
  1. When requested enter the password root
  2. You are now at the MySQL command prompt. Type the following and press return:

    SET PASSWORD FOR 'root'@'localhost' =OLD_PASSWORD('root');

    Query OK indicates you have created a short password hash.
  1. Close the command prompt window (top right cross).
  2. Restart the servers; check you can access MySQL using phpMyAdmin.

You will need to update phpMyBackupPro:

  1. From apanel run phpMyBackupPro
  2. Login as root root,
  3. Select the configuration tab:
    Change the MySQL password to root
    Finally click Save Data

That completes the downgrade.

Top


Ric