×

magento2php链接

magento2php链接(magento2安装教程)

admin admin 发表于2023-04-01 06:20:08 浏览48 评论0

抢沙发发表评论

本文目录一览:

Ubuntu 安装 magento2

年龄大了,记性不好,以前过目不忘,现在一天也记不住一个命令,所以想陆续把这几年学到的知识记录下来,以备忘。

一切安装说明如果不介绍版本,都是在瞎逼逼 。

Ubuntu:ubuntu-16.04.2-desktop-amd64.iso

Magento:Magento-CE-2.2.4_sample_data-2018-05-01-09-59-08.tar.bz2

为何要开启root?节省后续各种权限不够,sudo的输入,懒人必备。

1、设置root密码:sudo passwd root

2、修改文件并保存:sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

autologin-user=root

user-session=ubuntu

greeter-show-manual-login=true

如果开机出现错误,修改以下文件并重启:

gedit /root/.profile

将mesg n替换成tty -s mesg n

注意以上操作仅限学习用。如果想真正建站,还需要在安全的权限下进行 。

由于国内墙限制,系统自带的源无法连接更新,所以要替换成国内的源。

gedit /etc/apt/source.list

把里面的内容删除,全部替换成以下内容:

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted

deb-src xenial main restricted #Added by software-properties

deb xenial main restricted

deb-src xenial main restricted multiverse universe #Added by software-properties

deb xenial-updates main restricted

deb-src xenial-updates main restricted multiverse universe #Added by software-properties

deb xenial universe

deb xenial-updates universe

deb xenial multiverse

deb xenial-updates multiverse

deb xenial-backports main restricted universe multiverse

deb-src xenial-backports main restricted universe multiverse #Added by software-properties

deb xenial partner

deb-src xenial partner

deb xenial-security main restricted

deb-src xenial-security main restricted multiverse universe #Added by software-properties

deb xenial-security universe

deb xenial-security multiverse

保存后,输入以下命令更新系统。

apt update

apt upgrade

1、安装:apt install apache2

2、编辑文件:gedit /etc/apache2/sites-available/000-default.conf

文件最后添加:

Directory "/var/www/html"

    AllowOverride ALL

/Directory

3、重启服务:service apache2 restart

4、浏览器输入:,有内容显示(It works!)表示安装成功。

1、apt install php7.0 libapache2-mod-php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv php7.0-soap-magento2php链接

2、php-v

3、service apache2 restart

1、apt install mysql-server mysql-client

2、mysql_secure_installation

3、mysql -u root -p

4、create database magento2_db;

5、GRANT ALL ON magento2_db.* TO magento@localhost IDENTIFIED BY 'magento';

6、flush privileges;

7、最后在终端输入:mysql -u magento -p,如果能进入表示安装和配置成功。

magento2 需要 apache2 启用 rewrite mod

终端运行命令:a2enmod rewrite

然后运行:service apache2 restart

1、把magento2压缩包解压到/var/www/html/magento2文件夹内

2、chown -R www-data.www-data /var/www/html/magento2

3、chmod -R 755 /var/www/html/magento2

4、浏览器输入:localhost/magento2/setup

按提示安装即可。

如何解决magento2安装过程中缺少两个php扩

缺少两个php扩展,对应安装配置即可。

进入cd /home/freeman/tools/lnmp1.2-full/src/php-5.6.9/ext/intl/

执行$phpize ./configure --with-php-c/local/php/bin/php-config make make install

在这个configure的过程中会出现错误,安装相应的lib就行。

$yum install libicu-devel -y

$yum install libxslt-devel -y

cd /home/freeman/tools/lnmp1.2-full/src/php-5.6.9/ext/xsl/

$phpize ./configure --with-php-c/local/php/bin/php-config make make install

修改php.ini

$vi /usr/local/php/etc/php.ini

增加:

extension=xsl.so

extension=intl.so

然后重启php服务/etc/init.d/php-fpm restart

再回到/home/wwwroot/magento2下面执行

$composer install

[root@localhost magento2]# composer install

Loading composer repositories with package information

Installing dependencies (including require-dev) from lock file

- Installing magento/magento-composer-installer (0.1.5)

Downloading: 100%

- Installing braintree/braintree_php (2.39.0)

Downloading: 100%

这样就成功了。

Zen Cart还有 magento 与PHP有什么联系?

zen-cart和magento都是一种网站程序,写出这个程序用的语言就是PHP。

magento1.8版本本地安装后访问index.php显示无法连接(FF中显示为空白页面)没有报错

上一下显示无法连接的图

或者在index.php中,

#ini_set('display_errors', 1);

去掉这一句前面的“#”,然后把

Mage::setIsDeveloperMode(true);

也加在下一行(这样做是为了能显示错误),然后再刷新页面看看是什么错误