Install Magento on Ubuntu

来源:互联网 发布:时间计时器软件 编辑:程序博客网 时间:2024/05/16 01:05

1. install apache

sudo apt-get install apache2

2. install php

sudo apt-get install php5

[视情况而定]

sudo apt-get install libapache2-mod-php5

3.install mysql

apt-get install mysql-server

apt-get install mysql-client

4. Install lib 

apt-get install php5-mysql

apt-get install php5-curl

 apt-get install php5-gd

apt-get install php5-mcrypt

[视情况而定]

sudo apt-get install libmysqlclient15-dev

sudo apt-get install php5-dev


5. create database

create database “magento” and check if DB support innode.


************************************************************************

Install Issue


PHP extension “pdo_mysql” must be loaded.
PHP extension “mcrypt” must be loaded.
PHP extension “curl” must be loaded.
PHP extension “gd” must be loaded.

pdo_mysql is just the MySQL module for php5 (apt-get install php5-mysql)
mcrypt is resolved with apt-get install php5-mcrypt.
apt-get install php5-curl solves next issue.
Finally, gd is resolved by apt-get install php5-gd.

*************************************************************************************************************

常规情况下以上的方式就可以正常安装了。

当遇到异常情况时,可以考虑使用源码编译(make)的方式安装每一个部件,这样一定是可以成功的,只是比较麻烦。

模块文件是在php源文件/ext目录下面去编译,关键是是在configure的时候,一定要指对参数,特别是和mysql安装路径相关的时候。

如果用apt-get安装的mysql,指明mysql安装路径时是/usr,因为mysql被安装的太分散了,我们主要考虑它启动文件的位置。所以/usr相当于mysql安装根目录。

pdo连接数据库时,记住至少要在php.ini加载3个模块文件

pdo_mysql.so

[./configure --with-php-config=/usr/local/php5/bin/php-config --with-pdo-mysql=/usr]

mysql.so

[./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysql=/usr]

mysqli.so

[./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysqli=/usr/bin/mysql_config]

如果不行考虑加

pdo.so

[./configure --with-php-config=/usr/local/php5/bin/php-config]

另外还要注意使用phpize添加模块的版本问题,一定要和php保持一致。只要使用php安装路径/bin里面的phpize就不会有问题。

网上有很多解决方案是升级降级或者重装软件,不值得推荐,还是应该多花点精力了解模块加载不成功的原因。总之万能解决方案就是源码编译,手动编辑配置文件。

*****************************************************************************************************************

Install PHP (make)

./configure  --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs  --with-libxml-dir=/usr/local/libxml2

make

sudo make install


原创粉丝点击