Mysql+Apache2+php5 installation_PHP tutorial
Download the following files to /usr/local/src/
apache (the most popular WEB server platform on Unix platform) 2.tar.gz
MySQL (the best combination with PHP)-5.0.22.tar.gz
php (as the current mainstream development language)-5.1.2.tar.gz
Unzip:
#tar xvz (parallels virtual row platform) f apache (the most popular WEB server platform on Unix platform) 2.tar.gz
#tar xvz (parallels virtual row platform) f MySQL (the best combination with PHP)-5.0.22.tar.gz
#tar xvz (parallels virtual row platform) f php (as the current mainstream development language)-5.1.2.tar.gz
#cd .. //Create a folder in the /usr/local/ directory
# mkdir apache (the most popular WEB server platform on Unix platform)
# mkdir MySQL (the best combination with PHP)
# mkdir php (as the current mainstream development language)
//MySQL (the best combination with PHP) installation process
#cd ../MySQL (The best combination with PHP) //Find the /usr/local/MySQL (The best combination with PHP) folder
#groupadd MySQL (the best combination with PHP)
#usseradd -g MySQL (The best combination with PHP) MySQL (The best combination with PHP)
#cd ../MySQL (The best combination with PHP)-5.0.22 //Find the /usr/local/src/MySQL (The best combination with PHP)-5.0.22 folder
#./configure --prefix=/usr/local/MySQL (the best combination with PHP) --localstatedir=/var/lib/MySQL (the best combination with PHP)/ --with-client-ldflags =-all-static --with-MySQL (the best combination with PHP) d-ldflags=-all-static --with-MySQL (the best combination with PHP) d-user=MySQL (the best combination with PHP) the best combination) --enable-assembler --with-extra-charsets=all
#make ; make install
/usr/local/MySQL (The best combination with PHP)/bin/MySQL (The best combination with PHP)_install_db //Initialize MySQL (The best combination with PHP)
//Configure MySQL (the best combination with PHP)
#chown –R root /usr/local/MySQL (the best combination with PHP)
#chown –R MySQL (The best combination with PHP) /var/lib/MySQL (The best combination with PHP)/
#chgrp –R MySQL (The best combination with PHP) /usr/local/MySQL (The best combination with PHP)
#cp support-files/my-medium.cnf /etc/my.cnf
/usr/local/MySQL (The best combination with PHP)/bin/MySQL (The best combination with PHP) d_safe –user=MySQL (The best combination with PHP) & //Start MySQL (the best combination with PHP) The best combination)
/usr/local/MySQL (the best combination with PHP)/bin/MySQL (the best combination with PHP) admin –u root –p password 123 //Change the password to 123
enter password:
//Test the new password
/usr/local/MySQL (The best combination with PHP)/bin/MySQL (The best combination with PHP) –u root –p MySQL (The best combination with PHP)
enter password: //If everything goes well, you can enter MySQL (the best combination with PHP).
//apache (the most popular WEB server platform on Unix platform) installation process
./configure --prefix=/usr/local/apache (the most popular WEB server platform on Unix platform) --enable-mods=shared=all --enable-module=so --disable-info
make
make install
During the installation process of apache (the most popular WEB server platform on Unix platform), the problem of libiconv.so.2 was encountered. The solution is as follows:
ln –sf /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
//Type the local IP in the window bar. If the famous Feather web page appears, it will be considered successful...
//php (as the current mainstream development language) installation process
./configure --prefix=/usr/local/php (as the current mainstream development language) --with-MySQL (the best combination with PHP) =/usr/local/MySQL (the best combination with PHP) combination) --with-apxs2=/usr/local/apache (the most popular WEB server platform on Unix platform)/bin/apxs --enable-calendar --with-openssl=/usr/ --with-config-file- path=/usr/local/php (as the current mainstream development language)
make
make install
cp /usr/local/src/php (as the current mainstream development language)-5.1.2/php (as the current mainstream development language).ini-dist /usr/local/lib/php (as the current mainstream development language) Mainstream development languages).ini
#cd usr/local/apache (the most popular WEB server platform on Unix platform)/conf
//Then open httpd.conf and modify it in the corresponding place
AddType application/x-httpd-php (as the current mainstream development language) .php (as the current mainstream development language)
AddType application/x-httpd-php (as the current mainstream development language)-source .php (as the current mainstream development language) s
DocumentRoot "/usr/local/apache (the most popular WEB server platform on Unix platform)/htdocs"
LoadModule php (as the current mainstream development language) 5_module modules/libphp (as the current mainstream development language) 5.so
//Put the tested .php (as the current mainstream development language) file into /usr/local/apache (the most popular WEB server platform on Unix platform)/htdocs/. If the page can be opened in the window bar, you are done.
//FAQ 1: ERROR 2002: Can't connect to local MySQL(The best combination with PHP) server through socket '/var/lib/MySQL(The best combination with PHP)/MySQL(The best combination with PHP) The best combination).sock
' (2)
//Solution: Permission problem
chown -R MySQL (The best combination with PHP) /var/lib/MySQL (The best combination with PHP)/
//FAQ 2: Warning: MySQL (the best combination with PHP) Connection Failed: Can't connect to local MySQL (the best combination with PHP) server
// through socket '/tmp/MySQL (the best combination with PHP).sock' (111) in /home/httpd/html/show.php (as the current mainstream development language) on line 9
//Solution: Link /tmp/MySQL (the best combination with PHP).sock link to the /var/lib/MySQL (the best combination with PHP) directory:
linux# ln -s /var/lib/MySQL(The best combination with PHP)/MySQL(The best combination with PHP).sock /tmp/MySQL(The best combination with PHP).sock

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

How to view the Apache version? Start the Apache server: Use sudo service apache2 start to start the server. View version number: Use one of the following methods to view version: Command line: Run the apache2 -v command. Server Status Page: Access the default port of the Apache server (usually 80) in a web browser, and the version information is displayed at the bottom of the page.

How to configure Zend in Apache? The steps to configure Zend Framework in an Apache Web Server are as follows: Install Zend Framework and extract it into the Web Server directory. Create a .htaccess file. Create the Zend application directory and add the index.php file. Configure the Zend application (application.ini). Restart the Apache Web server.

Apache cannot start because the following reasons may be: Configuration file syntax error. Conflict with other application ports. Permissions issue. Out of memory. Process deadlock. Daemon failure. SELinux permissions issues. Firewall problem. Software conflict.

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.
