Two days ago, I had trouble. now all the Linux server upgrades have been completed. here I will share the updated documents with you _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Two days ago, I had trouble. now all the Linux server upgrades have been completed. here we will share the updated documents with you. Step 1. check the installation modes of MySQL, Apache, and PHP: The main purpose of this part is to understand the installation modes of MySQL, Apache, and PHP, so as to select how to delete the Linux server upgrade step 1. check the installation modes of MySQL, Apache, and PHP: The main purpose of this part is to understand the installation modes of MySQL, Apache, and PHP, and select the method to delete the old version. 1. MySQL: # rpm-q mysql package mysql is not installed. The result shows that MySQL is not installed using an RPM package, but a binary package. 2. Apache: # rpm-q apache-1.3.12-2 shows that Apache is installed in an RPM package with version 1.3.12-2. 3. PHP: # rpm-q php php-3.0.15-2 shows that PHP is installed with an RPM package and the version is 3.0.15-2. 2. back up the files on the Linux server: 1. MySQL: Export database file, and Export all the previous MySQL databases. 2. PHP3: back up the source file of PHP. 3. Apache: Due to Linux version issues, the new version of Apache, whether it is RPM (Redhat Package Management) or binary Package, cannot be installed successfully. Apache has not been upgraded, but the key httpd. conf file has been modified (this part will be detailed later ). 3. delete old versions of MySQL and PHP: select different deletion methods based on the installation mode detected in "2. 1. mySQL: it has been detected that a binary package is used for installation and uninstallation. run the "find-name" command to find the path of all MySQL files, use the "rm-rf file path" command to delete the files one by one. 2. Apache: Apache has not been upgraded due to Linux version issues. 3. PHP: since "2" has detected that PHP3 is installed in RPM Mode, you only need to run: # rpm-e php-3.0.15-2 error: removing these package wowould break dependencies: php is needed by php-imap-3.0.15-2 php is needed by php-ldap-3.0.15-2 php is needed by php-pqsql-3.0.15-2 php is needed by piranha-qui-0.4.12-1 after running, the error shown above. Solution: run the "find" command to find the path of each package displayed above, delete the package one by one, and run the command again. You can also use the rpm command to delete these files one by one. # Rm-rf package path 4. install the new version: The new version of MySQL and PHP are all stored in the "/rootmetadata" directory, which is the tar package of mysql-3.23.46.tar.gzand php-4.0.6.tar.gz. 1. MySQL: (1) # run cd/root to enter the root directory. (2) # tar-zxvf mysql-3.23.46.tar.gz put the previous mysql new version of the tar package in the root directory, unpackage. (3) # cd mysql-3.23.46 to enter the directory of mysql after unpacking. (4 )#. /configure-prefix =/usr/local/mysql> -- with-berkeley-db =. /bdb> -- with-tcp-port = 3306> -- with-mysqld-user = mysql> -- with-charset = gb2312> -- with-extra-charset = latinl configure mysql: ① installation path; ② support the bdb database type and transaction processing; ③ set the port to 3306. (Note that if this configuration statement is not written during configuration, or 9999 is written, will cause MySQL to fail to enter normally .) ④ Set the user; (5) # make compilation. (6) # make install. (7) # create an initial database in scripts/mysql_install_db (8) # chown-R root/usr/local/mysql # chown-R mysql/usr/local/mysql (9) # adduser mysql add mysql User (10) # cd/etc/rc. d/init. d # cp/root/mysql-3.23.46/support-files/mysql. server mysql # chmod + x mysql add execution permission (11) #/sbin/chkconfig-del mysql #/sbin/chkconfig-add mysql run chkconfig, add mysql to the startup service group of the system (12) # reboot restart Linux server (13) # cd/usr/local/mys Ql/bin #. /mysql enter MySQL (14) mysql> show databases; + ---------- + | Database | + ---------- + | mysql | test | + ---------- + 2 rows in set (0.11 sec) display the MySQL database (15) mysql> use mysql to enter the mysql database (16) mysql> grant all on *. * to admin @ '%' identified by '000000'; set the user and password (17) mysql> quit Bye to exit MySQL (18 )#. /mysql-u root admin-p Enter password: MySQL is successfully installed and tested by following the user and password you just set. The next step is to Import the database files backed up before (Import. MySQL-Front is also used. However, it should be noted that when you Import a library file before, you must first create a database and must have the same name as before. 2. Apache: Although the Linux server is upgraded, the final result is Apache or the original version. But here, I would like to mention the installation process of Apache with RPM Package: First find the CD of Linux6.02, in which the "RedHat/RPM" directory, there is a file named apache-1.3.12-2.i386.rpm. Because the Linux server does not have CDROM, the method is the same as previously mentioned. now, in Windows, copy the files in this directory, and then copy them to the directory enabled by Samba through the LAN. (1) # cp/home/httpd/html/pos/bak/apache-1.3.12-2.i386.rpm/root copy the RPM package file to the directory "/root" (2) # cd root enter the root directory (3) # rpm-I apache-1.3.12-2.i386.rpm to install the apache-1.3.12-2.i386.rpm kit to the Linux server, the default installation path is :. /usr/lib/apache. if it is a binary package, the path should be/usr/local/apache. (4) #/etc/rc. d/init. d/httpd start run Apache. If the result is as follows, Starting httpd: OK] (5) # ps aux | grep httpd can be started normally to query the entire system, all of which contain httpd (Apache Server ), and the program is being executed. Root 1368 0.0 3.4 4560 2196? S httpd nobody 1371 0.0 3.6 4668 2280? S httpd nobody 1372 0.0 3.6 4668 2280? S httpd nobody 1373 0.0 3.6 4668 2280? S httpd ...... (6) If Apache runs normally, you can browse the welcome page of Apache from IE on other machines. So far, Apache Web Server has been installed and tested successfully. 3. PHP: (1) #/etc/rc. d/init. d/httpd stop Apache (2) # cd/root to enter the root directory. (3) # tar-zxvf php-4.0.6.tar.gz put the previous PHP4 tar package under the root directory, unpackage. (4) # cd php-4.0.6 to enter the directory of PHP4 after unpacking. (5 )#. /configure-apxs =/usr/sbin/apxs> -- with-config-file-path =/etc/httpd/conf> -- with-mysql =/usr/local/mysql> -- with-gd> -- with-zlib> -- with-system-regex> -- enable-ftp: ① If you install apxs in another path, you must change "/usr/sbin/apxs" to point to the path of the apxs script program. Generally, the binary package path is "/usr/local/apache/bin/apxs", and the RPM package path is "/usr/sbin/apxs ". ② Configure PHP to the DSO module of Apache. The configuration file will be saved in "/etc/httpd/conf" (together with the Apache configuration file); ③ if MySQL is installed in an RPM Package, change "-- with-mysql =/usr/local/mysql" to "-- with-mysql" ④ if the GD library is not available, cancel "-- with-gd" ⑤ if you want to support ftp upload, you need "-- enable-ftp" (6) # make compilation. (7) # make install. (8) # reboot restart the Faresever Server 5. configuration: configure this part for Apache httpd. conf file. we require that Apache, which has not been upgraded, be able to parse PHP4 or PHP4. The Apache server of Linux server is packaged in RPM, so the httpd. conf file is placed in "/etc/httpd/conf/httpd. conf ". Edit the configuration file as follows: 1. find # LoadModule php3_module modules/libphp3.so in this file and change it to: # LoadModule php4_module/usr/lib/apache/libphp4.so. function: Set the PHP3 Module loaded by Apache, change to the PHP4 Module, followed by the Module file path. 2. find the file] # AddModule mod_php3.c and change it to # AddModule mod_php4.c. function: change the Module added by Apache from PHP3 to PHP4. 3. find Port 80 in the file and add the following statement: DirectoryIndex index.html index.shtml index. cgi index. phtml index. php3 index. php AddType application/x-httpd-php. php3 AddType application/x-httpd-php. php AddType application/x-httpd-php-source. phps function: it can be an unupgraded Apache, which can parse both PHP3 and PHP4. So far, the Apache configuration file "/etc/httpd/conf/httpd. conf" in version 1.3.12 has been modified. 6. possible errors during installation: 1. MySQL: (1) if the installation of MySQL enters the front (13), an error occurs and cannot be entered normally. Error cause: the port settings are incorrect. Run the "netstat-t-l-p" command to check the network status. it is found that there is no mysql, and only one port of 9999 is running. Modification method: ① check/usr/local/mysql/bin/safe_mysqld to see if there is any behavior MYSQL_TCP_PORT =$ {MYSQL_TCP_PORT:-9999} and change it to MYSQL_TCP_PORT =$ {MYSQL_TCP_PORT: -3306} ② use the VI editor to view and modify the settings. # Vi/usr/local/mysql/bin/safe_mysqld ③ restart mysql #/etc/rc. d/init. d/mysql. server stop #/etc/rc. d/init. d/mysql. server start (2) an error occurs when connecting to MySQL. the php file is changed to 127.0.0.1 to be connected normally. Error cause: Permission error. Modification method: delete the user table of the mysql database. a record with a Host of fareserve.fareexpress.com and a blank User is displayed. 2. Apache: you want to install a new version of Apache 1.3.22. However, no matter the RPM package or binary package, it cannot be installed successfully. This is because of the Linux version. The previous version of Apache is used, and the RPM Package is used for installation. No problem occurs. 3. PHP: installation is successful. After installation, you cannot browse FareExpress (PHP3), Power POS Management (PHP4) in IE, and then modify httpd of Apache. conf (configuration file), which is clearly described in "configuration" in the previous step. we will not repeat it here.

Tips 1. check the installation modes of MySQL, Apache, and PHP: The main purpose of this part is to understand the installation modes of MySQL, Apache, and PHP, so as to select how to delete them...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.