Board index   FAQ   Search  
Register  Login
Board index System Administration Server installation and configuration

Upgrade PHP - Backward Incompatible changes

Discuss server installationa nd configuration issues here

Moderators: macek, egami, gesf

Upgrade PHP - Backward Incompatible changes

Postby amirk » Wed Jun 20, 2012 9:39 am

Hi,

I've inherited a sever on which PHP is installed:

Code: Select all
$ php -version

PHP 5.1.6 (cli) (built: Nov  3 2006 10:51:56)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies



Quite an old version of PHP. I'd like to move an existing site to a new server with recent version of PHP installed on it and I'd like to do it as safely as I could.

Would I be able to compile the existing code against a newer version of PHP to ensure nothing's broken (e.g.: no backward incompatible function or feature is used)? Or do I have to go version by version and extract changes from change logs and search the code for possible infringement?
Could Zend Engine do that for us?

Thanks,
~Amir
amirk
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Jun 20, 2012 9:22 am

Re: Upgrade PHP - Backward Incompatible changes

Postby egami » Wed Jun 20, 2012 10:18 am

You could always run the code from command line

php -l filename.php

and it will report any incompatibilities.
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2197
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Upgrade PHP - Backward Incompatible changes

Postby amirk » Wed Jun 20, 2012 11:07 am

Thanks. I suppose running
Code: Select all
find . -name "*.php" -exec php -l '{}' \;
from website's root directory does the trick.

But "-l" does a syntax check. Is that sufficient (in Java, for instance, we compile codes)? Also, does Zend Engine help at all?

I'm sorry if the questions don't make sense. I'm not really a PHP developer.
amirk
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Jun 20, 2012 9:22 am

Re: Upgrade PHP - Backward Incompatible changes

Postby egami » Wed Jun 20, 2012 12:48 pm

That should do the trick..


results will look like this..

Code: Select all
No syntax errors detected in ./wiki/tests/selenium/SeleniumTestListener.php
No syntax errors detected in ./wiki/tests/selenium/SeleniumTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiHelpFieldHintTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiInstallationConfig.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiInstallationCommonFunction.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiInstallationVariables.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiInstallerTestSuite.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiInstallationMessage.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiUserInterfaceTestCase.php
No syntax errors detected in ./wiki/tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php
No syntax errors detected in ./wiki/tests/selenium/SeleniumServerManager.php
No syntax errors detected in ./wiki/tests/selenium/SeleniumTestConsoleLogger.php
No syntax errors detected in ./wiki/tests/selenium/SeleniumTestHTMLLogger.php
No syntax errors detected in ./wiki/tests/selenium/Selenium.php
No syntax errors detected in ./wiki/tests/selenium/SeleniumLoader.php
No syntax errors detected in ./wiki/tests/selenium/SeleniumTestConstants.php
No syntax errors detected in ./wiki/tests/selenium/suites/SimpleSeleniumTestSuite.php
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2197
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT


Return to Server installation and configuration

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron