Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache+php+mysql+phpMyAdmin Total Strategy under Red Flag 5.0 (turn)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Apache+php+mysql+phpMyAdmin Total Strategy (transfer) [@ more@] repost under Red Flag 5.0

This is my apache+php+mysql+phpMyAdmin installation process on Red Flag 5. 0. It works well and no problem has been found so far.

The following four compressed files are required:

Mysql-standard-4.1.12-pc-linux-gnu-i686.tar.gz (download address http://dev.mysql.com/downloads/mysql/4.1.html)

MySQL-client-4.1.14-0.i386.rpm (mysql client) (download address http://dev.mysql.com/downloads/mysql/4.1.html)

Httpd-2.0.54.tar.gz (download address http://httpd.apache.org/download.cgi)

Php-4.4.0.tar.gz (download address http://www.php.net/downloads.php#v4)

PhpMyAdmin-2.5.7-pl1.tar.gz (download address http://www.phpmyadmin.net/home_page/downloads.php)

Put all the compressed files in / root

Extract the mysql-standard-4.1.12-pc-linux-gnu-i686.tar.gz and rename the folder to mysql for convenience. Move to / usr/local/ (you can also make a link to / root/mysql at / usr/local)

[root@shunzi ~] # mv mysql / usr/local/mysql

This is binary, does not need to compile, just need to do some corresponding configuration can be used.

[root@shunzi ~] # groupadd mysql

[root@shunzi ~] # useradd-g mysql mysql

[root@shunzi ~] # cd / usr/local/mysql

[root@shunzi mysql] # scripts/mysql_install_db-- user=mysql

[root@shunzi mysql] # chown-R root.

[root@shunzi mysql] # chown-R mysql data

[root@shunzi mysql] # chgrp-R mysql.

[root@shunzi mysql] # bin/mysqld_safe-- user=mysql &

See:

[1] 5134

[root@shunzi mysql] # Starting mysqld daemon with databases from / usr/local/mysql/data

STOPPING server from pid file / usr/local/mysql/data/shunzi.pid

030102 21:00:46 mysqld ended

Prompt startup failed, this is due to permission issues, execute the following command:

Chown-R root / usr/local/mysql

Chgrp-R mysql / usr/local/mysql

Execute:

[root@shunzi mysql] # bin/mysqld_safe-- user=root &

You can see something like this:

[1] 5846

5846 pts/1 S 0:00 / bin/sh bin/mysqld_safe-user=root

5864 pts/1 S 0:00

/ usr/local/mysql/bin/mysqld

-defaults-extra-file=/usr/local/mysql/data/my.cnf-ba

This indicates that the mysql service has been started. The mysql server was installed successfully. If not, check the permissions of the mysql file again.

Then install the client MySQL-client-4.1.14-0.i386.rpm, which also double-clicks to install. Execute:

[root@shunzi mysql] # mysql

ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ var/lib/mysql/mysql.sock' (2)

Prompt can not find the interface file, excuse file in / tmp/mysql.sock, you can establish a soft link:

[root@shunzi mysql] # mkdir / var/lib/mysql

[root@shunzi mysql] # cd / var/lib/mysql

[root@shunzi mysql] # ln-s / tmp/mysql.sock mysql.sock

Execute:

[root@shunzi mysql] # mysql

Welcome to the MySQL monitor. Commands end with; or g.

Your MySQL connection id is 11 to server version: 4.1.12-standard

Type 'help;' or' h' for help. Type 'c'to clear the buffer.

Mysql >

Indicates that the client can connect to the mysql server; for security, then set the password for the root user:

Mysql > quit

Bye

[root@shunzi mysql] # cd / usr/local/mysql/bin

[root@shunzi bin] # mysqladmin-u root-h localhost password * (change your password)

*

Install apache:

[root@shunzi ~] # tar xzvf httpd-2.0.54.tar.gz

[root@shunzi ~] # cd httpd-2.0.54

The detailed configuration can be viewed with. / configure-- help. Here is just my configuration.

[root@shunzi httpd-2.0.54] #. / configure-prefix=/usr/local/apache

-enable-shared=max-enable-module=rewrite-enable-module=most

[root@shunzi httpd-2.0.54] # make

[root@shunzi httpd-2.0.54] # make install

Start the apache service:

[root@shunzi httpd-2.0.54] # / usr/local/apache/bin/apachectl start

Type http://localhost, in the browser if you can see the welcome page, then apache is installed successfully.

*

Install php:

To stop apache first:

[root@shunzi ~] # / usr/local/apache/bin/apachectl stop

[root@shunzi httpd-2.0.54] # / usr/local/apache/bin/apachectl stop

[root@shunzi php] #. / configure

-prefix=/usr/local/php-with-mysql=/usr/local/mysql

-with-apxs2=/usr/local/apache/bin/apxs-enable-track-vars

-enable-ftp-enable-inline-optimization

-enable-trans-sid-with-xml-with-gd=/usr/local/gd

-with-png-dir=/usr/local/png-with-zlib-dir=/usr/local/zlibc

-with-jpeg-dir=/usr/local/jpeg-with-freetype-dir=/usr/local/freetype

(install png,zlibc,jpeg,freetype under / usr/local/ beforehand,)

You can see:

+-- +

| |

License:

| |

| | This software is subject to the PHP License, available in this |

| distribution in the file LICENSE. By continuing this installation |

| process, you are bound by the terms of this license agreement. | |

| | If you do not agree with the terms of this license, you must abort |

| | the installation process at this |

Point.

| |

+-- +

| |

* NOTE

***

| |

| | The |

Default for register_globals is now

OFF! |

| |

| |

| | If your application relies on register_globals being ON, you |

| | should explicitly set it to on in your php.ini |

File.

| |

| | Note that you are strongly encouraged to |

Read

| |

| |

Http://www.php.net/manual/en/security.globals.php

| |

| | about the implications of having register_globals set to on, and |

| | avoid using it if |

Possible.

| |

+-- +

Thank you for using PHP.

[root@shunzi php] # make

[root@shunzi php] # make install

Copy php.ini-dist to / usr/local/lib and rename it to php.ini.

[root@shunzi php] # cp php.ini-dist.. / lib/php.ini

Next, you can simply configure the httpd.conf file, and you can refer to other materials for detailed configuration.

Open / usr/local/apache/conf/httpd.conf

Find the LoadModule php4_module modules/libphp4.so line and add it below

AddType application/x-httpd-php .php .phtml

Find the DirectoryIndex index.html index.html.var and add it later

Index.php index.php3 index.phtml index.htm

Make it support php scripts.

Look for DocumentRoot "/ usr/local/apache/htdocs" and change the directory to the directory where the web page content is stored. According to my experience, it is often not enough to change this alone, because there will be mistakes in the interview.

Find it and change it to. Just browse again at this time.

If there is an index.* file in the root directory of the site, browse the file automatically, and if not, the directory of the site is displayed. Before the website is done, I am used to letting it display the directory, which is easy to debug.

To test whether php is working properly, edit a phpinfo.php file as follows:

Phpinfo ()

? >

Open this file in a browser. If you see the configuration information of php, the php is normal.

Install phpMyAdmin-2.5.7

Now the latest version is 2.6.4, but I found that the Chinese content of the database is garbled after installation, so I don't know how to solve it, so I chose 2.5.7, this version shows that Chinese is very good.

Extract the file to the root directory of the web page, name it phpMyAdmin, and edit the config.inc.php file in its directory.

$cfg ['Servers'] [$I] [' port'] = '80mm; (port)

$cfg ['Servers'] [$I] [' user'] = 'root'; (user name)

$cfg ['Servers'] [$I] [' password'] =''; (password)

$cfg ['PmaAbsoluteUri'] =' http://localhost/phpMyAdmin/'; (otherwise there will be a warning asking you to configure)

You can connect by typing http://localhost/phpMyAdmin in the browser. The default is the Chinese interface.

At this point, the apache+php+mysql+phpMyAdmin installation is complete.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report