Build PHP (LAMP), install zend to optimize resolution speed, and build the phpmyadmin management system on its platform to manage mysql on pages

Source: Internet
Author: User
Tags mcrypt php software
Build PHP (LAMP), install zend to optimize resolution speed, and build the phpmyadmin management system on its platform to manage mysql on pages Specific operations:

1.Preparations

To avoid program conflicts, we recommend that you first uninstall php installed in rpm Mode and related dependent packages (if any.

2.Install extension Tool Library

In actual enterprise applications, some PHP-based Web application systems require additional extension tools, such as the data encryption tool libmcrypt, mhash, and mcrypt (which can be downloaded from the sf.net website ). Install these extension tool programs before installing the php software package.

1) install libmcrypt

2) install mhash

3) install mcrypt:

3.Compile and install PHP

1)Unpack

2)Configuration

?-- Prefix:Specifies the directory to which the PHP program is installed.

?-- With-mcrypt:Supports data encryption and other extension tools.

?With-apxs2:Set the file settings of the apxs module support program provided by Apache HTTP Server.

?-- With-mysql:Set the installation location of the MySQL database service program.

?-- With-config-file-path:Set the location where the PHP configuration file php. ini will be stored.

?-- Enable-mbstring:Enable the multi-byte string function to support Chinese and other code.

If the configuration is incorrect, it may be that a webpage in xml format is missing. install the webpage and reconfigure it again. :

3)Compilation and installation

NSet the LAMP component environment

1.Php. iniConfiguration adjustment

After the php software package is installed, the server does not automatically create the php. ini configuration file. However, two sample configuration files are provided in the source code directory, which correspond to the development and production environments respectively.

Select a sample file, copy it to the PHP configuration file directory (ensure that it is consistent with the path specified in the configure step), and change it to php. ini. In the php. ini configuration file, the content starting with a semicolon represents the comment information.

By modifying the configuration content in the php. ini file, you can control the execution features of PHP web pages. For example, whether to allow users to upload files, set the size limit of uploaded files, set the default character set, and load additional extension modules. If there are no special requirements, you can directly use the default configuration without any modification.

To further improve the execution efficiency of PHP programs and optimize the page loading speed, you can add ZendGuardLoader optimization module developed by Zend for PHP. To encrypt PHP code to restrict unauthorized branches, you can also purchase ZendGuard software for the company.

First release the downloaded ZendGuardLoader package and copy the module file under the php-5.3.x directory to the module folder of the PHP program.

Modify the php. ini configuration file and add the configuration statement for loading and enabling ZendGuardLoader. so module.

2.Httpd. confConfiguration adjustment

To enable the httpd server to support the PHP page parsing function, load the module file of the PHP program using the LoadModule configuration item, and add support for the ". php" type webpage file through the AddType configuration item. In addition, you should modify the DirectoryIndex configuration line and add the "index. php" item to identify common PHP homepage files.

In the above configuration content, the LoadModule line should be automatically added during php installation. "php5_module" indicates the module name, and "module/libphp5.so" indicates the module file location. The AddType row needs to be manually added, and the DirectoryIndex row can be modified on the original basis.

NTest LAMP collaboration

1.Test whether PHP web pages are correctly displayed.

Compile a test webpage file in ". php" format. Use the built-in "phpinfo ()" function of PHP to display the PHP environment information of the server. The PHP code should be included in" Between tags. Place the test file in the root directory of the website.

Then, access it through a browser. if you can see the PHP program version number, configuration command, run variable, and other information, the Web server can display the PHP webpage normally. If the Zend Engine information is displayed, the ZendGuardLoader module is enabled successfully.

2.Test whether the PHP webpage can access the MySQL database

Write a test webpage file and add simple database operation commands to verify the connection and query operations with the MySQL server. The "mysql_connect ()" function is used to connect to the MySQL database. you must specify the target host address and the authorized user name and password.

Then access the test webpage through the browser. if you can see the prompt message of successful connection, it means you can access the MySQL database through the PHP webpage. If the user name or password is incorrect, or the connection fails because mysqld is not running, an error is reported during execution.

NDeploy the phpMyAdmin system

PhpMyAdmin is a Web application system written in php to manage MySQL databases. Through the web interface provided by the suite, even those who are not familiar with SQL statements can easily manage and maintain the MySQL database.

1.Unpack the package and copy it to the website directory

For most PHP application systems, you only need to unpack the package and copy it to the website directory to complete the deployment. then, adjust the configuration as needed, or visit the installation page for further installation.

2.Create the configuration file config. inc. php

After you copy the phpMyAdmin suite to the website directory, you need to create a configuration file for normal use. The default sample configuration file is config. sample. inc. you need to create the config. inc. php configuration file by referring to the file content. Search for and modify the "blowfish_secret" line in the configuration file, and set a phrase key (this key is used for web page cookie authentication and does not require user memory ).

3.Access the phpMyAdmin Web Management Interface

Access http: // 192.168.10.10/phpMyAdmin/in the browser. if you can see the phpMyAdmin logon interface, the deployment is successful. After logging on to a MySQL database user (not a user with an empty password), you can manage the database within the authorization scope.

By default, The phpMyAdmin system uses the cookie authentication method. during the first visit, a message "Cookies must be enabled to log on" may be displayed at the bottom of the page, requiring the client's browser to enable the cookies mechanism. In fact, most browsers support cookies by default. Therefore, after you press F5 to refresh the page, the prompt will disappear.

4.Use the phpMyAdmin system

To use the phpMyAdmin system, you must first log on to the database user (such as root) authorized in the MySQL server. after successful authentication, you can see the management interface ,. With phpMyAdmin, you can perform various database management operations within the scope of authorization, making the interface more intuitive and friendly, greatly reducing the difficulty of remote maintenance of the MySQL database server.

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.