系统升级: PHP(5.1.6->5.4.7) & CI(1.7.2->2.1.2)调查记录

2019-03-27 01:05|来源: 网路

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

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() and session_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

 

 



转自:http://www.cnblogs.com/puzbus/archive/2012/10/10/3356347

相关问答

更多
  • 怎样把安卓系统升级到7.0,解决办法: 1.手机用户已安装了早期的体验版MIUI系统,则会自动提示更新系统,以刷入Android7.0最新系统。 2.当然,对于符合Android7.0内测资格的用户,会通过MIUI论坛收到刷机包。此时就可以通过“关于手机”-“系统更新”功能,选择“本地刷机包”来实现系统的升级操作。 3.完全关机状态下,同时按“音量-”和“电源键”进入Fastboot模式。 4.将手机与电脑连接,并运行“MiFlash线刷工具”程序,点击“浏览”按钮以选择本地Android7.0刷机包,勾选 ...
  • 内核升级是linux kernel升级,系统升级是安卓版本升级。
  • 目前安卓手机主要采用以下几种方式升级: 1、使用手机自带的系统更新功能 在安卓手机的设置--关于手机中,可以看到当前安卓手机的系统版本,另外这里也有自动检测更新系统功能。 安卓手机自带的系统更新功能,其更新主要由手机厂商提供,像小米手机就可以很好的通过该功能升级手机系统版本。不过使用该功能升级系统,需要下载不少升级文件,因此建议在Wifi环境下进行。 注意:使用手机自带的系统更新功能仅对部分品牌手机比较实用,通常很多品牌手机的自带的升级功能,可升级的非常慢,并且无法更新到最新的安卓系统版本,因此一般也不建议 ...
  • 1在更新升级之前首先要将手机里面的重要数据进行备份,以免丢失。备份数据可以通过手机同步助手或者是91手机助手等同步工具来进行备份, 2备份完成以后,点击手机界面上面的设置,进入到手机设置窗口, 3进入到手机设置窗口之后,在窗口上面点击通用, 4点击通用之后,进入到通用窗口,在窗口上面点击系统升级, 5点击系统升级之后进入到系统升级窗口,在窗口上面点击立即检查更新,如果你的手机系统是最新状态就不用升级了,如图有更新的版本就需要更新的版本下载到手机上面, 6我们可以通过把系统升级设置为自动检查,这样可以再有系统 ...
  • 1.以root用户登陆GBAM服务器。 2.输入命令rm /etc/adjtime,删除adjtime. 3.输入命令date月日时分年,修改和设置系统时间。 例如,如果想把GBAM时间设置成2006年11月26日12点01分,输入命令date 112612012006即可。 4.输入命令clock–w,同步硬件时钟和系统时间。 5.完成以上步骤后,使用reboot命令重启GBAM服务器,使用date命令看一下,时间是否已经正确修改。
  • 很简单的 去安卓论坛下载ZIP或者BIN的刷机包 之后放到SD卡 就可以刷机 我建议说一说吧 ZIP刷机方法 去论坛下载之后 直接放到SD卡 之后手机关机状态下 同时按下三个按键 分别是 小房子 音量+ 开机键 不久会出现菜单 之后选择ZIP刷机--在SD卡中选择ZIP刷机包--选中后确认 之后出现进度条等待完成 BIN刷机方法 下载BIN刷机包 这个刷机适合砖头机 也就是无法开机的手机 是急用的 下载BIN之后 在电脑桌面新建image文件夹 之后将下载下来的BIN文件文件名如果不是image那么请修改文 ...
  • 你的手机固件版本是什么呢?通过*#1234#查看下喔。你可以到官网的固件下载地区下载对应机型的最新固件,然后双清升级试试,记得提前备份,防止资料丢失。
  • 可以进入设置--更多设置--系统升级检测安装点击确认升级即可。
  • 请问指的是手机在线升级还是固件包升级? 1、手机在线升级可以进入设置--更多设置--系统检测安装更新即可。 2、若是固件升级,可以进入官网首页--服务--搜索自己使用的机型打开即可看到升级教程,请了解一下。
  • 进入设置--更多设置--系统升级中检测更新即可。 升级注意事项: 1、手机系统没有被root过; 2、电量保持在50%以上或者将连接电源; 3、备份手机中重要的数据。