原谅我懒....英文调查记录实在不想翻译了....

Introduction

This document states the details of the changes from PHP5.1.6 to the latest version 5.4.5 and the impact on SORT web codes and otherlibraries.

Currently, the basic environment for SORT site is likebelow:

-         RedHat Enterprise Linux Server release 5.5 (Tikanga)  x86_64

-         PHP5.1.6

-         MySQL5.5.24 Enterprise

After upgrade, the investigation environment is

-         RedHat Enterprise Linux Server release 6.3 (Santiago)

-         PHP5.4.5

-         MySQL5.5.27 Community

Majorchanges from PHP 5.1.6 to 5.4.5

Although most existing PHP 5.1.6 codes should work withoutchanges, you should pay attention to the following major changes that isimportant for our project. (For details, please refer to the official webpage:migration5.2 , migration53 and migration54.

2.1 BackwardIncompatible Changes

2.1.1 PHP 5.4:

§  Safe mode has been DEPRECATED as of PHP 5.3.0 andREMOVED as of PHP 5.4.0.

§  Magic quotes has been DEPRECATED as of PHP 5.3.0 andREMOVED as of PHP 5.4.0.get_magic_quotes_gpc() and get_magic_quotes_runtime() now always return FALSE. set_magic_quotes_runtime() raises an E_CORE_ERROR levelerror.

Code that maybe effected:

-         application/pear/Mail/mime.php

You can download the latest pear-mail andMail_Mime from the website to replace the current oldversion in our project.

§  The register_globals and register_long_arrays php.ini directiveshave been removed since 5.4.

§  Call-timepass by reference hasbeen DEPRECATED in 5.3 and REMOVED as of PHP 5.4.When calling a function, use& in foo(&$a); is not allowed.

§  The break and continue statements no longer accept variablearguments (e.g., break 1 + foo() * $bar;) since 5.4. Static arguments still work, such as break2;. Butbreak 0; and continue 0; are no longer allowed.

§  Datetime support change. You should set the timezonemanually in any of this two ways (using the TZ environment variable is allowedin 5.3, but removed in 5.4):

§ in php.ini usingthe date.timezone INIdirective

§ from your script using the function date_default_timezone_set()

§  Non-numeric string offsets (5.4)- e.g. $a['foo'] where $a is a string - now returnfalseon isset() andtrue on empty(), andproduce a E_WARNING,if you try to use them. Offsets oftypes double, bool and null produce a E_NOTICE. Numeric strings (e.g. $a['2']) still work as before.

-Note: Offsetslike '12.3' and '5foo' are considerednon-numeric and produce an E_WARNING, but are converted to 12 and 5 respectively,for backward compatibility reasons.

-Note:Following code returns differentresult. $str='abc';var_dump(isset($str['x'])); // false for PHP 5.4 orlater, but true for 5.3 or less

§  Converting an array to a string will generate an E_NOTICE level error, but the result of the cast will still be thestring "Array"since 5.4.

“Severity:Notice  --> Array to string conversion“

§  Turning NULLFALSE, or anemptystring into an object by adding a property willnow emit an E_WARNING level error, instead of E_STRICTsince 5.4.

$test = null;

test->baz = 1; //E_STRICT error

§  Parameter names that shadow super globalscause a fatal error since 5.4.This prohibits code like

function foo($_GET, $_POST) {}.

§  The Salsa10and Salsa20 hashalgorithms have beenremoved since 5.4.

§  array_combine() now returns array() insteadof FALSE when two empty arrays are provided as parameters since 5.4.

§  The default character set forhtmlspecialchars() and htmlentities() is now UTF-8.  If you use htmlentities() with Asian character sets, an E_STRICT level error isemitted since 5.4.

§  The following keywords are reserved since 5.4.

-trait

-callable

-insteadof

§  The following functions have been removedfrom PHP:

-         define_syslog_variables()since 5.4

-import_request_variables()since 5.4

-session_is_registered(),session_register()andsession_unregister()since 5.4.

-mysqli_bind_param(),mysqli_bind_result(),mysqli_client_encoding(),mysqli_fetch(),mysqli_param_count(),mysqli_get_metadata(),mysqli_send_long_data(), mysqli::client_encoding() and mysqli_stmt::stmt()since 5.4.

§  The following functions have been deprecated

-         mcrypt_generic_end()since 5.4

-         mysql_list_dbs()since 5.4

2.1.2 PHP 5.3

§ The newer internal parameter parsing API hasbeen applied across all the extensions bundled with PHP 5.3.x. This parameterparsing API causes functions to return NULL when passed incompatible parameters. There are someexceptions to this rule, such as the get_class()function, which willcontinue to return FALSE onerror.

§ clearstatcache() no longer clears the realpathcache by default.

§ realpath() isnow fully platform-independent. Consequence of this is that invalid relativepaths such as__FILE__. "/../x" do not work anymore.

§ The call_user_func()family of functions now propagate$thiseven if the callee is a parent class.

§ The array functions natsort(), natcasesort(), usort(), uasort(), uksort(), array_flip(),and array_unique() nolonger accept objects passed as arguments. To apply these functions to anobject, cast the object to an array first.

§ The behavior of functions with by-reference parameters called by valuehas changed. Where previously the function would accept the by-value argument,a fatal error is now emitted. Any previous code passing constants or literalsto functions expecting references, will need altering to assign the value to a variablebeforecalling the function

One possible case:

modify from

$this->CI =& get_instance();

Into

$CI =& get_instance();

§  Thenew mysqlnd library does not read mysql configuration files (my.cnf/my.ini), asthe older libmysql library does. If your code relies on settings in theconfiguration file, you can load it explicitly with the mysqli_options() function.Note that this means the PDO specific constantsPDO::MYSQL_ATTR_READ_DEFAULT_FILE and PDO::MYSQL_ATTR_READ_DEFAULT_GROUP arenot defined if MySQL support in PDO is compiled with mysqlnd.

§  Thetrailing / has been removed from the SplFileInfo classand other related directory classes.

§  The __toString() magicmethod can no longer accept arguments.

§  Themagic methods __get(), __set(), __isset(), __unset(),and __call() mustalways be public and can no longer be static. Method signatures are nowenforced.

§  The __call() magicmethod is now invoked on access to private and protected methods.

§  func_get_arg(), func_get_args() and func_num_args() canno longer be called from the outermost scope of a file that has been included bycalling includeor require fromwithin a function in the calling file.

§  Anemulation layer for the MHASH extension to wrap around the Hash extension havebeen added. However not all the algorithms are covered, notable the s2k hashingalgorithm.This means that s2k hashingis no longer available as of PHP 5.3.0.

§  keywords“goto” and “namespace”are now reserved and may not be used in function, class, etc. name.

§  Assigning the return value of new by reference is deprecated.

§  Deprecatedfeatures in PHP 5.3.x. and add two new error levels: E_DEPRECATED andE_USER_DEPRECATED.

Thefollowing is a list of deprecated INI directives. Use of any of these INIdirectives will cause an E_DEPRECATED error to be thrown at startup.

-         define_syslog_variables

-         register_globals

-         register_long_arrays

-         safe_mode

-         magic_quotes_gpc

-         magic_quotes_runtime

-         magic_quotes_sybase

-         Comments starting with '#' are now deprecatedin .INI files.

Deprecatedfunctions and replacement:

-         call_user_method()              =>          call_user_func()

-         call_user_method_array()                 =>          call_user_func_array()

-         define_syslog_variables()

-         dl()

-         ereg()                                         =>          preg_match()

-         ereg_replace()                        =>          preg_replace()

-         eregi()                                        =>          preg_match()

-         eregi_replace()                       =>          preg_replace()

-         set_magic_quotes_runtime()andmagic_quotes_runtime()

-         session_register()                                 =>          $_SESSION

-         session_unregister()            =>          $_SESSION

-         session_is_registered()      =>          $_SESSION

-         set_socket_blocking()         =>          stream_set_blocking()

-         split()                                          =>          preg_split()

-         spliti()                                         =>          preg_split()

-         sql_regcase()

-         mysql_db_query()                                =>          mysql_select_db() and mysql_query()

-         mysql_escape_string()        =>          mysql_real_escape_string()

-         Passing locale category names as strings is nowdeprecated. Use the LC_* family of constants instead.

-         The is_dst parameterto mktime().Use the new timezone handling functions instead.

2.1.3 PHP 5.2:

§ getrusage()returns NULL when passedincompatible arguments since PHP 5.2.1.

§ ZipArchive::setCommentName()and ZipArchive::setCommentIndex() returns TRUE on success since PHP 5.2.1.

§ SplFileObject::getFilename()returns the filename, not relative/path/to/file since PHP 5.2.1.

§ Changed priority of PHPRC environment variableon Win32. The PHPRC environment variable now takes priority over the pathstored in the Windows registry.

§ CLI SAPI no longer checks cwd for php.ini or thephp-cli.ini file.

§ Since PHP 5.2.0, __toString()  is not only called with echo or print called,it is now in any string context (e.g. in printf() with %s modifier) but not inother types contexts (e.g. with %d modifier). Converting objects without__toString() method to string would cause E_RECOVERABLE_ERROR.

§ Dropped abstract staticclass functions since 5.2.

§ Oracle extensionrequires at least Oracle 10 on Windows.

§ Added RFC2397 (data: stream) support.

§ Regression in glob()patterns. Since 5.2.5, the glob() function will return FALSE when openbase_dirrestrictions are violated

§ New extensionsare added in PHP since 5.2: Filter, Zip and JSON,whichis enabled by default.

§ New parameters, new functions, new methods, newclasses, new global and class constants, and new INI Configuration Directives  and other enhancements.(Details)

2.2 Removed Extensions

Theseextensions have been moved to PECL and are no longer part of the PHPdistribution. The PECL package versions of these extensions will be createdaccording to user demand.

2.2.1 PHP 5.4

§  Removed sqlite- Note that ext/sqlite3 and ext/pdo_sqlite are not affected

2.2.2 PHP 5.3

§ dbase - No longer maintained

§ fbsql - No longer maintained

§ msql - No longer maintained

§ fdf - Maintained

§ ming - Maintained

§ ncurses – Maintained, became php-pecl-ncurses

§ sybase - Discontinued; use the sybase_ct extension instead

§ mhash - Discontinued; use the hash extension instead. hash has full mhash compatibility; allexisting applications using the old functions will continue to work.

2.2.3 PHP 5.2

§ filePro

§ Hyperwave API

 

2.3 NewExtensions

Thefollowing are new extensions added (by default) as of PHP 5.2.0:

§ Filter - validates and filters data,and is designed for use with insecure data such as user input. This extensionis enabled by default; the default mode RAW does not impact input data in anyway.

§ JSON - implements the JavaScriptObject Notation (JSON) data interchange format. This extension is enabled bydefault.

§ Zip - enables you to transparentlyread or write ZIP compressed archives and the files inside them.

2.4 New classes, functions, methods parameters and othernew staffs

There are several new features appeared from PHP 5.2 to PHP5.4, which will not make big effects on our existing codes, but could provideus more convenient or more efficient way to construct our project in thefuture, so it is strongly recommended for all programmers to take a look at thenew features added in the new version, for details, please refer to themigration guide on PHP officialwebsite.

 

3.     Majorchanges in CodeIgniter 2.1

Nowthe latest CI 2.1.2 supports PHP 5.1.6 or newer, compared with the old CI1.7.0, it changes a lot in both the code implantation and the folderstructure.  You should pay attention tothe following major changes that is important for our project. (For details,please refer to the official webpage: Change log and Upgradingguide).

3.1 After 1.7.2:

1.       CodeIgniteris compatible with PHP 5.3.0

2.       404status headers are now properly handled in the show_404() method itself, so Ifyou are using header() in your 404 error template, such as the case with thedefault error_404.php template shown below, remove that line of code.

<?phpheader("HTTP/1.1 404 Not Found"); ?>

3.2 After 2.0.0:

1.      Removed support for PHP 4. Required PHP 5.1.6 orabove.

2.       File structure changes:

§  Pluginshave been removed, in favor of Helpers .

§  Movedthe application folder outside of the system folder (as we are doing now).

§  Movedsystem/cache and system/logs directories to the application directory.

§  Removedirectory CodeIgniter from system/

§  Removescaffolding from system/

§  Anew /system/core/ folder is created for some libraries considered more corethan others such as Router, Loader, Security and Controller.

§  Weneed to create a folder /application/core/. If you extend any library that hasnow moved to /system/core/ you must now place it in /application/core/

3.       All core classes and Cache driver are nowprefixed with CI_, pay attention whenextending them.

4.       Allnative CodeIgniter classes now use the PHP 5 __construct() convention.We should update extended libraries to callparent::__construct()

5.       Addednew special Library type: Drivers.

6.       Removedthe deprecated Validation Class.

7.       Thecompatibilityhelper has been removed. All methods in it should be nativelyavailable in supported PHP versions.

8.      Move xss_cleanfunction from input into security. So use it like this

$this->security->xss_clean();

9.      Addeda new config item to the Session class sess_expire_on_close to allow sessions toauto-expire when the browser window is closed.

10.  Addedan encode_from_legacy() method to provide a way to transitionencrypted data from CodeIgniter 1.x to CodeIgniter 2.x

11.  Database:

·        Removedthe following deprecated functions: orwhere, orlike, groupby, orhaving,orderby, getwhere.

·        Removedeprecated _drop_database() and _create_database() functions from the dbutility drivers.

·        $this->db->count_all_results() will now return an integerinstead of a string.

·        Databasesessions changed, If you are using database sessions with the CI SessionLibrary, please update your ci_sessions databasetable as follows:

CREATE INDEXlast_activity_idx ON ci_sessions(last_activity); ALTER TABLE ci_sessions MODIFYuser_agent VARCHAR(120);

·        Addedsupport for IPv6, In order to store them, you need to enlarge your ip_addresscolumns to 45 characters. For example session table will need to change:

ALTER TABLE ci_sessionsCHANGE ip_address ip_address varchar(45) default '0' NOT NULL

12.  An incompatibility in PHP versions< 5.2.3 and MySQL < 5.0.7 with mysql_set_charset() createsa situation where using multi-byte character sets on these environments maypotentially expose a SQL injection attack vector. Latin-1, UTF-8, and other"low ASCII" character sets are unaffected on all environments.

If you are running orconsidering running a multi-byte character set for your database connection,please pay close attention to the server environment you are deploying on toensure you are not vulnerable.

13.  EXT is marked as deprecated. Removedinternal usage of the EXT constant.

14.  addmore user agent types in application/config/user_agents.php

15.  Removed APPPATH.'third_party' fromthe packages autoloader

16.  Thisconfig file is updated to contain more user mime-types in application/config/mimes.php.

4.     How -to

4.1 How to upgrade PHP

1.      Backupthe PHP configuration setting for

/etc/php.ini and /etc/php.d

2.      Backup httpd.conf under /etc/httpd/conf, andafter step 4, make sure that ‘AllowOverride All’ is set for the document root.This is required to make .htaccess work.

3.      Keep a record of what PHP extensions you haveinstalled, which will be referred when install PHP5.4 versions of theseextensions. This command needs to be run on dev-sort or our SORT productionserver to get the information.

yum list installed php php-* > php_list.txt

4.      UpgradeOS from RHEL 5 to RHEL 6, by default, PHP 5.3.3. php-memcache.so is installed,we don’t need to configure it.

5.      Upgrade to PHP 5.4 versions and the relatedextensions which have been installed

yum update php php-*

6.      Install PHP 5.4 extension according to thephp_list.txt. (refer to the removed extension)

yum install php-devel php-gd  php-ldap php-mysql php-pdophp-pear php-soap php-xml

Note #1: No need toinstall json.so, which is already integrated in php.

Note #2: before php-imap, we needlibc-client.so.2007()(64bit)

It can be downloadedfrom  ftp://ftp.muug.mb.ca/mirror/centos/6.3/os/x86_64/Packages/libc-client-2007e-11.el6.x86_64.rpm

7.      Updatethe php.ini configuration by updating the following, please refer to4.3 #1 section below for details.

short_open_tag = On

date.timezone = GMT (it depends on which time zone we willuse for the server)

To enablememcache.so, add

[memcached]

extension=memcache.so

8.      Onceyou’ve configured PHP. Do the following to make sure everything is ok:

Run either of the following two  from the command line:

php –m

php –i

or write a PHP file(e.g. index.php) with the followingcontent and access from http request:

<?php echophpinfo(); ?>

You should see a list ofenabled modules, for instance, mysql, soap, xml etc,   and thefull details about PHP configuration.

9.      Restartapache

Service httpd restart

4.2 How to upgrade CI

1.      Downloadthe latest CI framework

2.      Backupthe old CI and web codes in a separate folder

3.      Removethe ‘old’ system/ directory and place the latest system/ directory in CIframework

4.      Replacethe index.php with the ‘new’ CI one

5.      Convertall plugins to helpers if used.

6.      Replaceapplication/config/mimes.php with the ‘new’ one

7.      AddCodeIgniter 2.1.2’s new directories, core, third_party, and logs underapplication/

8.      Changedirectory permission for logs to allow logging by

chmod –R 777 application/logs/

9.      Weused to customized application/config/user_agents.php, so we have to merge thenew agents into our original file as follows:

$browsers = array(

‘Flock’=> ‘Flock’,

‘Chrome’=> ‘Chrome’,

… …

);

and

$mobiles = array(

… …

‘ipad’                          => “iPad”,

… …

);

4.3 Configuration& SORT code changes1.      Update/etc/php.ini:

1.1  Weneed to put the following lines in php.ini manually after migration.

[Copy back from dev-sort]

·        max_execution_time= 1000

·        memory_limit= 256M

·        extension_dir= "/usr/lib64/php/modules"

·        enable_dl= On

·        upload_max_filesize= 15M

·        short_open_tag= On

·        post_max_size= 15M

·        include_path=".:/sortdev/home/david_lowe/pear/share/pear"; Added by go-pear

·        extension=memcache.so

(Maybe you don’t needthis, if you compiling the extension directly into the PHP binary, or therewill be a warning. There are two ways to load most extensions in PHP. One is bycompiling the extension directly into the PHP binary. The other is by loading ashared extension dynamically via an ini file. Refer to http://www.somacon.com/p520.php)

[New setting required]

·        date.timezone= GMT //required,  (available timezone)

Set the time zoneexplicitly  or the program will encounteran error as

“Message:main(): It is not safe to rely on the system's timezone settings. You arerequired to use the date.timezone setting or the date_default_timezone_set()function. In case you used any of those methods and you are still getting thiswarning, you most likely misspelled the timezone identifier. We selected'America/Los_Angeles' for '-8.0/no DST' instead”

1.2  What’snew in PHP 5.4 php.ini that may require your attention

Below is part of the changes

[Removed]

·        zend.ze1_compatibility_mode= Off

·        [mSQL]related settings are removed.

·        [sybase]related settings are removed.

·        [Informix]related settings are removed.

·        [VerisignPayflow Pro] related settings are removed

·        [FrontBase]related settings are removed

[Added &Modified]

·        zend.enable_gc= On  ;Enables or disables the circularreference collector.

·        error_reporting= E_ALL & ~E_DEPRECATED ; Show all errors except for deprecated

·        html_errors= Off ;

·max_file_uploads = 20

·        allow_url_include= Off

·        request_order= "GP"

·        mail.add_x_header= On

·        variables_order= "GPCS"

·        session.bug_compat_42= Off

·        session.bug_compat_warn= Off

2.     Update index.php

Modify the updatedindex.php according to the original file, add two lines in the head:

·        error_reporting(E_ALL);

·        ini_set('display_errors',1);

3.     Database related update

·        Updatethe ci_sessions database table as follows:

CREATE INDEX last_activity_idx ON ci_sessions(last_activity);ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120);

·        Updatethe IP address tables. The upgrade adds support for IPv6 IP addresses. In orderto store them, Please enlarge the ip_address columns to 45 characters. Forexample, CodeIgniter's session table will need to change:

ALTER TABLE ci_sessions CHANGE ip_address ip_addressvarchar(45) default '0' NOT NULL

·        Checkall the $this->db-> select function used in the code to confirmthat when using compound select statement, if you don’t want CI to protect yourfield or table names with backticks, you must set the optional second parameterto FALSE. For example: In application/models/asl/asl_model.php,update line 103 as follow,

$this->db-> select ('concat('.self::TBL_ASL_LIBRARY.'.LIB_ID,"#",'.self::TBL_ASL_RELEASE.'.RELEASE_ID)as LIB_R,'.self::TBL_ASL_VERSION.'.VERSION',false);

You cannot use like models/settings/notifi_center_model.phpeither ,

$query =$this->db->select("subscribe_id,group_concat(message_id)message_ids,send_time",false)

->where_in("subscribe_id", $sbsc_id_array)

->where("subscribe_type_id", $type)

->where("date_add(send_time, interval ".$month_ago."month) > curdate()")

->where("successful", 1)

->order_by("send_time", "desc")

->group_by("concat(subscribe_id,'',mail_id)")

->get("notification_log");

Thefollowing will cause database problem:

->group_by("concat(subscribe_id,' ',mail_id)")

4.     Update in application/config/

·        config.php:Define the encryption keyon line 226

$config['encryption_key'] = "sort"; //You can changeit with another key

Note: Even if you are notusing encrypted sessions, you must set an encryption key in your config filewhich is used to aid in preventing session data manipulation. - source:http://codeigniter.com/user_guide/libraries/sessions.html

·        mimes.php:update xml type on line 86

'xml'  =>  array('text/xml','application/xml'),

Note: without thismodification, fatal error will happen when uploading a xml type of report.

5.      Error_404.php

Remove header() from 404error template, 404 status headers are now properly handled in the show_404()method itself. In our case, update error_404.php

·Remove<?php header("HTTP/1.1 404 NotFound"); ?>

6.      Deprecated Functions that requiresreplacement

-         define_syslog_variables()should be deleted

extra/conf/php.ini_DEV

extra/conf/php.ini_QA

extra/conf/php.ini_STG

extra/conf/php.ini_PROD

-         ereg()         =>          preg_match()

application/libraries/Docs.php

application/helpers/imgs_helper.php

application/views/reports/ra_win_report_sample.php

application/views/reports/ra_report_sample_cluster.php

application/views/reports/ra_win_report_sample_cluster.php

application/views/reports/ra_report_sample.php

-         eregi()        =>          preg_match()

application/libraries/reports/iar_maps.php

application/helpers/browser_helper.php

-         set_magic_quotes_runtime()andmagic_quotes_runtime(),required to process the quotation marks manually.(Howto modify the code?)

application/pear/Mail/mime.php

system/core/CodeIgniter.php : @set_magic_quotes_runtime(0);// Kill magic quotes

-         split()          =>          preg_split()(or explode() if separator without regular expression)

Many file uses thisdeprecated function in code, for example:

application/models/vias_doc_model.php:

replace $oss = split(',',$inputs['PLATFORM']);

with $oss = preg_split('/\,/',$inputs['PLATFORM']);

-         mysql_escape_string()        =>          mysql_real_escape_string()

application/helpers/encode_helper.php

application/views/hcl/hcl_diskarray.php

application/models/patch/patch_search_model.php

mysql_real_escape_string() takesa connection handler and escapes the string according to the current characterset. mysql_escape_string() does not take a connection argument anddoes not respect the current charset setting.

7.      Xss_clean()

Now xss_clean() is part ofsecurity library, so replace the any code like

$this->input->xss_clean()

With

$this->security->xss_clean()

Update it in followingfile:

·        application/libraries/SymSSO.php

·        application/controllers/search.php

·        application/controllers/netbackuphfauditor.php

8.      Moveextended core classes. For example: move application/libraries/VOS_Controller.php into application/core/

9.      Update core Class extension withprefix “CI_”, forexample:

For all controllers in ourproject:

“class Xxx extends Controller”

should be updated as

“class Xxx extends CI_Controller”

Thesame for Models

10.  Update Parent Constructor calls. All native CodeIgniter classes nowuse the PHP 5 __construct() convention. Update extended libraries to callparent::__construct(VOS_Controller and VOS_User_agent). For example:

function __construct(){

parent::Controller();

}

Should be updated as

function __construct(){

parent::__construct();

}

Command:

sed -i "s/extends Controller/extendsCI_Controller/g" `grep "extends Controller" -rl ./`

sed -i"s/parent::Controller()/parent::__construct()/g" `grep"parent::Controller()" -rl ./`

11.  InPHP 5.3 and above we cannot use $this->CI without declaration as usedin

application/models/patch/patch_matrix_model.phpon line 158

We suggest tomodify from

$this->CI=& get_instance();

into

$CI =& get_instance();

 

12.  When using the relativepath, please add “<?=base_url()?>” in the head.

13.  Removeall the “&” before new as follows:

$parser = &new Mail_RFC822();=> $parser =  new Mail_RFC822();

Found similar codes in

application/pear/Mail.php

application/libraries/Excel/reader.php

application/pear/Mail/smtp.php

Appendix A: Project Environment Set-up

Herelogs how to set up an environment like current production server beforeupgrade.

1.       LinuxRedhat Enterprise 5.8

2.       MYSQL5.1, copy database schema from dev-sort and dump some necessary data.

3.       PHP5.1.6

4.       Serverand Database: 10.200.15.82

5.       Copythe whole project under "/vosweb_37" from dev-sort

6.       Modifyapplication/config/database.php as follows:

$db[ST_DEFAULT]['hostname'] ="127.0.0.1";

$db[ST_DEFAULT]['username'] ="root";

$db[ST_DEFAULT]['password'] ="";

$db[ST_DEFAULT]['database'] ="SORT_3_7";

#$db[ST_DEFAULT]['port'] ="3308"; //remove this item

$db[ST_DEFAULT]['solr_port']= 8983;

7.       Modifyetc/php.ini

post_max_size = 15M

upload_max_filesize = 15M

short_open_tag = On

8.       Modify/etc/httpd/conf/httpd.conf

AllowOverride None =>AllowOverrideAll

 

9.       Restartthe http server

/etc/init.d/httpd restart

10.   Installfollowing php extension (which is not installed by default): bcmath.so, dba.so,dom.so, gd.so, imap.so, soap.so, json.so, xmlrpc.so, snmp.so.

yum –y install php-*

 

11.   Copyjson extension - the following two file from prepdev2 into test environment

/usr/lib64/php/modules/json.so

/etc/php.d/json.ini

12.   Installlibevent-1.4.13 and memcached 1.4.5, and php-memcache 2.2.6 and run memcached. Addthis item in the end of etc/php.ini

 [memcached]

extension=memcache.so

 

13.   CopySolr from Hui yuan’s workplace, put it in /opt/solr, and configure it.

application/config/database.php, changesolr_port to 8983.

Run it: java –D solr.solr.home=./multicore/ -jarstart2.jar

 

 

 

 

 

 

 

 

Php-memcache install

Downloadphp-memchache from http://pecl.php.net/package/memcache version inprepdev2 is 2.2.6

#tar –vxzf memcache-2.2.6.tgz

#cd memcache-2.2.6

#/usr/bin/phpize

# ./configure --enable-memcache --with-php-config=/usr/bin/php-config--with-zlib-dir

#make

#make install

Open php.ini andadd the following line in the tail

extension=memcache.so

 

 

转载于:https://www.cnblogs.com/puzbus/archive/2012/10/10/3356347.html

系统升级: PHP(5.1.6-5.4.7) CI(1.7.2-2.1.2)调查记录相关推荐

  1. svn 错误 以及 中文翻译

    比较长,如何查找不方便的话,用查找"CTRL+F"吧 # # Simplified Chinese translation for subversion package # Thi ...

  2. 苹果手机蓝牙与苹果电脑蓝牙怎么连接不上?

    2019独角兽企业重金招聘Python工程师标准>>> 1.苹果产品的蓝牙一般只能连接外设,不能传文件.所以不能搜索别的手机,一直处于搜索状态.然而使用蓝牙耳机.蓝牙音箱.蓝牙键盘这 ...

  3. 大佬们的精品博客[收藏+1]

    好博客总结 技术参考总结 云中王的博客: Centos7中文乱码 MariaDB安装与启动过程记录 logging模块 re模块 xml模块 shelve模块 json模块&pickle模块  ...

  4. 鸿蒙系统首批更新机器,鸿蒙系统升级名单

    [鸿蒙系统升级名单]华为的鸿蒙系统算是早早放出消息的重量级产品,国产OS的名号也吸引了不少小伙伴的注意.很多朋友都想体验传闻已久的鸿蒙操作系统,但也担心自己的手机无法支持.那么,鸿蒙操作系统的升级名单 ...

  5. 系统升级到10.13之后cocoapods安装失败问题解决办法

    系统升级到最新版本(10.13.x)之后发现cocoapods更新失败了,重新安装之后也提示如下错误: $ pod setup -bash: /usr/local/bin/pod: /System/L ...

  6. OTA常见方案分析(差分升级 全量升级 AB面升级 Recovery系统升级)

    1.全量升级:   完整的下载新版本固件,下载完成后将固件搬运到APP程序运行的位置.(一般来说是将APP从片外flash搬运到片内flash上).搬运完成后校验通过后重启APP. 2.差分升级:   ...

  7. Linux培训之系统升级

    2019独角兽企业重金招聘Python工程师标准>>> 当我们使用linux一段时间以后,自然不会满足总是在没有任何变化的系统中工作,而是渴望能象在windows系统中一样,不断对自 ...

  8. 观咆哮有感——系统升级的疼

    原本看了那篇"运维的咆哮从Linux到Windows"俺也就是笑笑,原因无它,俺也就是在当年安装维护过几个学校的Novell NetWare3.x/4.x的无盘,配置过基于NT4的 ...

  9. 荣耀手机现在可以升级鸿蒙系统吗,鸿蒙系统升级名单正式公布,华为手机90%能升,荣耀手机却有点意外...

    原标题:鸿蒙系统升级名单正式公布,华为手机90%能升,荣耀手机却有点意外 昨晚的鸿蒙系统发布会上,正式公布了今年可以升级鸿蒙系统的手机名单.2021年6月2日开始,第一批可以升级鸿蒙系统的终端,跟之前 ...

最新文章

  1. 深入jvm虚拟机第4版_深入JVM虚拟机,阿里架构师直言,这份文档真的是JVM最深解读...
  2. 【CT算法,radon变换】基于MATLAB的CT算法,radon变换的三维建模仿真
  3. MDT2008部署之二LTI部署之一
  4. python日历提醒_python打印日历
  5. Linux 脚本修改ini,Shell脚本读取ini配置文件的实现代码2例
  6. ubuntu更新python的指令_ubuntu下python模块的库更新(转载)
  7. 【视频特辑】数据分析师必备,快速制作一张强大好用的大宽表
  8. Asp.net 类中使用中括号([......])的作用
  9. 容器映像_容器映像中的内容:应对法律挑战
  10. 多线程并发-java内存模型和计算机基础
  11. tensorflow精进之路(十九)——python3网络爬虫(下)
  12. python海龟图画龙珠_DeepOps的Python小笔记-天池龙珠计划-Python训练营-Task 02:DAY5
  13. AttributeError: ‘_IncompatibleKeys‘ object has no attribute ‘cuda‘
  14. Ubuntu解决火狐浏览器无法同步书签的问题
  15. ubuntu系统安装百度云盘
  16. 绿色版本chrome设为默认浏览器
  17. GTK-sopcast 0.2.8
  18. 深入学习USB(10)otg功能介绍
  19. 盐酸二甲双胍pH敏感性壳聚糖水凝胶微球/木质素磺酸钠海藻酸钠壳聚糖水凝胶微球的研究制备
  20. 使用EXCEL进行计数

热门文章

  1. SIMetrix导入MOS管SPICE参数进行仿真的快速方法
  2. 乌尔维·阿西莫夫和 .art的不解情缘
  3. 适合自学单片机c语言教材,单片机编程入门看什么书 盘点单片机初学者适合看的书...
  4. 对于RISC-V的初步学习理解——RISC-V简介
  5. python 消息 推送服务器,从客户端发送字符串消息到服务器Python
  6. 号称BI商业智能界的“四大天王”
  7. Matlab谐波搭建
  8. C语言标准输入输出缓冲区
  9. 百亿互刷宝php 站长,百度排名百亿互刷宝
  10. 瑞波加入超级账本区块链联盟