CentOS6.0 (64-bit) Install Apache+php+mysql tutorial, install Magento (solve DOM,MCRYPT,GD problem) Complete tutorial

Source: Internet
Author: User
Tags install php mcrypt mysql tutorial php and mysql php tutorial server website iptables magento website

CentOS6.0 (64-bit) Install Apache+php+mysql tutorial, install Magento (solve DOM,MCRYPT,GD problem) Complete tutorial

0

Posted by: Little Black on:2012 September 28 views:7,586

Category:Linux to share, all share, technology sharing

Tags:centos-bash:make:command not found, Centos-bash:phpize:command not found, CentOS iptables:applying Firewal L Rules:iptables-restore:line 1 failed, centos6.0 PHP extension "DOM" must be loaded,centos6.0 PHP extension "GD" must b e loaded, centos6.0 PHP extension "Mcrypt" must be loaded, centos6.0 install Apache tutorial, centos6.0 install Magento, centos6.0 install MySQL tutorial, ce ntos6.0 Install PHP tutorial, CentOS associated PHP and MySQL module, checking for C + + compiler default output file name ... configure:error:c++ compiler C Annot Create executables, installing Apache+php+mysql

Server System: CentOS6.0 (64bit)

To view the CentOS version command:

[Email protected] ~]# cat/etc/redhat-release
CentOS Linux Release 6.0 (Final)

First, install the Apache+php+mysql

1. Install MySQL
Open SSH and enter:

[email protected] ~]# yum install MySQL Mysql-server

All [y/n] appears by pressing the Y key, and then pressing the ENTER key
After the installation is complete, set up Mysql to boot with the system:

[Email protected] ~]# chkconfig–levels 235 mysqld on
[[email protected] ~]#/etc/init.d/mysqld start

To set the password for the root account of MySQL:

[Email protected] ~]# mysql_secure_installation

Press ENTER directly when prompted as follows:

Enter Current password for root

Press the Y key and press Enter when prompted as follows:

Set root Password? [y/n]

You will be prompted to enter the Mysql password you need to set, press Enter and then enter the confirmation:

New Password:

Next there will be four confirmations, press the Y key directly, and then press the ENTER key:

Remove anonymous users? [y/n]
Disallow Root login remotely? [y/n]
Remove test database and access to it? [y/n]
Reload privilege tables now? [y/n]

2. Installing Apache
Since CentOS is already packaged with Apache, you can run the installation directly:

[email protected] ~]# Yum install httpd

After the installation is complete, set Apache to boot with the system:

[Email protected] ~]# chkconfig–levels 235 httpd on

When the configuration is complete, start Apache:

[[email protected] ~]#/etc/init.d/httpd start

3. Install PHP
Enter the installation command directly:

[[email protected] ~]# Yum install PHP

Installation Complete reboot Apache:

[Email protected] ~]#/etc/init.d/httpd restart

4. Test if PHP is installed successfully
Enter a command to create a PHP file, such as info.php

[Email protected] ~]# vi/var/www/html/info.php

Press "I" key to edit, enter:

<?php
PHP info ();
?>

After editing, press "ESC" key to exit edit mode, then press "shift+:" Key, enter:

Wq

Then enter, save and exit.
At this point you can view the PHP information by visiting http://[your server ip]/info.php, stating that the installation was successful
PS: If http://xxx.xx.xxx.xxx/info.php cannot be accessed, open the 80 port of your server in Iptables.

[Email protected] ~]iptables-i rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT
[Email protected] ~]service iptables restart

If the firewall fails to start "Iptables:applying Firewall Rules:iptables-restore:line 1 failed" error, please enter the following command:

[Email protected] ~]iptables-save >/etc/sysconfig/iptables
[Email protected] ~]service iptables restart


5. Associating PHP modules with MySQL modules
First, enter the command search module:

[email protected] ~]# Yum search php

To install the relevant modules:

[email protected] ~]# Yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

Restart Apache when the installation is complete:

[Email protected] ~]#/etc/init.d/httpd restart

Refresh the http://xxx.xx.xxx.xxx/info.php page to see if there is a MySQL module, if the module is shown, the installation is successful,

Summary: At this point, the Apache+php+mysql installation is complete.

Ii. Installation of Magento website

1. Here such as our website root directory for/home/www/html, first download Magento website program (: http://www.magentocommerce.com/download), Upload Magento website to server website directory/home/www/html and unzip, get/home/www/html/magento
2. Bind IP, domain name to Web site root directory:

[Email protected] ~]# vi/etc/httpd/conf/httpd.conf

Press "I" key to edit, press "↓" key to Last, enter

<virtualhost xxx.xx.xxx.xxx:80>
ServerAdmin [email protected]
Documentroot/home/www/html/magento
ServerName example.com
Errorlog Logs/dummy-host.example.com-error_log
Customlog Logs/dummy-host.example.com-access_log Common
</VirtualHost>

After editing, press "ESC" key to exit edit mode, then press "shift+:" Key, enter:

Wq

Then enter, save and exit.
3. Restart Apache:

[Email protected] ~]#/etc/init.d/httpd restart

4. Create a Web site database:
4.1 Log in to MySQL, enter the following command by pressing the ENTER key:

[Email protected] ~]# mysql-u root-p

4.2 Enter the password for MySQL, and then press ENTER (PS: Enter the password is not to show anything)

[Email protected]/]# mysql-u root-p
Enter Password:

4.3 After entering MySQL, enter the following command to create the database (e.g. our database name is Magentodatabase):

mysql> CREATE DATABASE Magentodatabase;

4.4 The following information indicates that the database was created successfully:

mysql> CREATE DATABASE Magentodatabase;
Query OK, 1 row Affected (0.00 sec)

5. Enter http://xxx.xx.xxx.xxx/install.php or a bound domain name in the browser http://example.com/ install.php Start Installing Magento (if the link is inaccessible, make sure Apache is started and open the 80 port of your service in iptables)
6. Tick the agreement, click Next, then click Next, the following message appears:

    • Path "/HOME/WWW/HTML/MAGENTO/APP/ETC" must be writable.
    • Path "/home/www/html/magento/var" must be writable.
    • Path "/home/www/html/magento/media" must be writable.

Enter the following command:

[Email protected] ~]# chmod-r 777/home/www/html/magento/app/etc
[Email protected] ~]# chmod-r 777/home/www/html/magento/var
[Email protected] ~]# chmod-r 777/home/www/html/magento/media

After assigning permissions to the corresponding directory, the Refresh page appears with the following information:

    • PHP extension "DOM" must be loaded
    • PHP extension "Mcrypt" must be loaded
    • PHP extension "GD" must be loaded

6.1 Resolve PHP extension "DOM" must be loaded, enter the following command:

[email protected] ~]# Yum install Php-xml

6.2 Fix PHP extension "GD" must be loaded, input

[email protected] ~]# Yum install PHP-GD

6.3 To resolve PHP extension "Mcrypt" must be loaded, follow these steps:
6.3.1 Download and install the Libmcrypt library

[Email protected] ~]# wget http://ncu.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
[Email protected] ~]# TAR-ZXVF libmcrypt-2.5.8.tar.gz
[[Email protected] ~] #cd libmcrypt-2.5.8
[Email protected] libmcrypt-2.5.8]#./configure

PS: If the checking for C + + compiler default output file name ... configure:error:c++ compiler cannot create executables error appears, enter The following command resolves:

[Email protected] libmcrypt-2.5.8]# yum-y install gcc gcc-c++ libstdc++-devel

[[email protected] libmcrypt-2.5.8]# make && make install

PS: If a-bash:make:command not found error occurs, please enter the following command to resolve:

[[email protected] libmcrypt-2.5.8]# Yum install make

PS: If the following error occurs, please enter the following command to resolve:

Make All-recursive
MAKE[1]: Entering directory '/var/www/html/ftp/libmcrypt-2.5.8′
Making All in Modules
MAKE[2]: Entering directory '/var/www/html/ftp/libmcrypt-2.5.8/modules '
MAKE[2]: * * * No rule to do target ' all '. Stop.
MAKE[2]: Leaving directory '/var/www/html/ftp/libmcrypt-2.5.8/modules '
MAKE[1]: * * * [all-recursive] Error 1
MAKE[1]: Leaving directory '/var/www/html/ftp/libmcrypt-2.5.8′
Make: * * * [ALL] Error 2

[[email protected] libmcrypt-2.5.8] #yum install Glibc-headers
[Email protected] Libmcrypt-2.5.8]yum install gcc-c++

6.3.2 Download and install the Mhash library

[Email protected] ~]# wget http://ncu.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
[Email protected] ~]# TAR-ZXVF mhash-0.9.9.9.tar.gz
[[Email protected] ~] #cd mhash-0.9.9.9
[Email protected] mhash-0.9.9.9]#./configure
[[email protected] mhash-0.9.9.9]# make && make install

6.3.3 installation and compilation via Phpize MCrypt
Download the current server version of PHP (using the PHP-V command to view the current PHP version): http://cn2.php.net/releases/

[Email protected] ~]# wget http://museum.php.net/php5/php-5.3.3.tar.gz
[Email protected] ~]# TAR-ZXVF php-5.3.3.tar.gz
[Email protected] ~]# CD Php-5.3.3/ext/mcrypt

Finding the Phpize Path first displays the following information, indicating that Phpize is under/usr/bin/phpize

[Email protected] mcrypt]# Whereis phpize
Phpize:/usr/bin/phpize/usr/share/man/man1/phpize.1.gz

PS: If the path shown is empty, the server does not have Phpize installed, please enter the following command to install:

[Email protected] mcrypt]# yum-y install Php-devel

Continue compiling MCrypt and enter the following command:

[Email protected] mcrypt]#/usr/bin/phpize
[Email protected] mcrypt]#./configure-with-php-config=/usr/bin/php-config
[[email protected] mcrypt]# make && make install

Add extension=mcrypt.so to PHP.ini

[Email protected] ~]# Vi/etc/php.ini

Press "I" key to edit, press "↓" key to Last, enter

Extension=mcrypt.so

After editing, press "ESC" key to exit edit mode, then press "shift+:" Key, enter:

Wq

Then enter, save and exit.
The final restart of Apache is complete installation:

[Email protected] ~]#/etc/init.d/httpd restart

6.4 Refresh the Magento installation page to automatically go to the next installation process, and then fill in the database name, MySQL user name, password, Administrator account, password and other information to complete the installation.

if following the above steps still does not resolve the PHP extension "Mcrypt" must be loaded problem or appear php extension "Pdo_mysql" must be loaded new issues, I recommend that you let the server to you reinstall CentOS6.0 system, do not let the server to install apache,php and MySQL for you.

CentOS6.0 (64-bit) Install Apache+php+mysql tutorial, install Magento (solve DOM,MCRYPT,GD problem) Complete tutorial

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.