magento安装遇到的问题,注册magento.com

6 Steps to Install Magento 2 on CentOS [Latest] - Sample Data

PHPer 2021-12-15 946 0 0

Step 1.4: Update php.ini file

Now time to increase values in php.ini file. Open php.ini file:

nano /etc/php.ini

Change the following data:

file_uploads = On

allow_url_fopen = On

short_open_tag = On

memory_limit = 512M

upload_max_filesize = 128M

max_execution_time = 3600

Then save this php.ini file.

After that, you should restart apache2. Run this command:

systemctl restart httpd

这里很重要,之前我命令行运行安装后一直报错:Could not validate a connection to Elasticsearch. No alive nodes found in your cluster,最后的原因是php分配的资源不够导致的。

另外一定要增加虚拟内存,至少要设置4G的虚拟内存。否则Elasticsearch带不动

原文链接:https://www.mageplaza.com/devdocs/how-install-magento-2-centos.html

You are looking forInstall Magento 2 latest version on CentOSfrom Magento repo or Github with Apache/Nginx, MySQL/MariaDB and PHP7.x, this guide is the best place for you. In this post, I will show youhow to install Magento 2.3 on CentOS latestwith Apache2, MariaDB. In previous posts, I talked aboutInstall Magento 2 on MAC OS,Ubuntu/DebianorWindows.

Magento 2 Requirements

You should double-check8 main requirements for Magento 2 here.

Step 1: Install Apache2 PHP and Required Extensions

I introduce the IUS Commyni repository for CentOS and Red Hat. It is a shell script to download and install necessary packages and PGP Keys.

curl 'https://setup.ius.io/' -o ius-installer.sh chmod 755 ius-installer.sh ./ius-installer.sh

After run above command line, Apache2 and MySQL has been installed.

yum update yum install httpd php72u php72u-pdo php72u-opcache php72u-xml php72u-mcrypt php72u-gd php72u-devel php72u-mysql php72u-intl php72u-mbstring php72u-json php72u-iconv php72u-mysqlnd php72u-fpm

Step 1.1 Install Apache2 Server

The Apache HTTP Server, called Apache, it is free and open-source cross-platform web server software. Apache is the most popular HTTP Server now. It runs on Linux, Windows, OpenVMS, NetWare and other operating systems.

To install Apache, you should update packages before running Apache install command:

sudo yum update sudo yum install apache2

Step 1.2 Configure Apache2 Virtual Host

To declear Apache2 site configuration for Magento 2 store, you have to create a new configuration filehttpd.conf:

nano /etc/httpd/conf/httpd.conf

Copy and paste the following content to the above file. Remember, you should changedomain.comto your domain.

ServerAdmin admin@domain.com DocumentRoot /var/www/magento2/ ServerName domain.com ServerAlias www.domain.com Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all ErrorLog /var/log/httpd/magento_error.log CustomLog /var/log/httpd/magento_access.log combined

If you are installing Magento locally, you can changedomain.comtolocalhost.com,dev.comorm2.com. Then you have to updatehostsfile at/etc/hostswith

127.0.0.1 localhost.com 127.0.0.1 dev.com 127.0.0.1 m2.com

IMPORTANT:

In this tutorial, I uselocalhost.com.

To check Apache new configuration run this command line:

apachectl configtest

After passing configuration test, now reload the configuration:

systemctl reload httpd

To run apache automatically during startup, run the following command line:

systemctl enable httpd

Enable Rewrite mod

Make sure you enable rewrite mod to use site friendly URLs, open filehttpd.conf:

nano /etc/httpd/conf/httpd.conf

Find this line:

# LoadModule foo_module modules/mod_foo.so # Include conf.modules.d/*.conf

Then add these following files:

LoadModule rewrite_module modules/mod_rewrite.so

Scroll down find this:

Options Indexes FollowSymLinks# # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride None

Then changeAllowOverride Noneto:

AllowOverride All

After that, reloadhttpdservice:

systemctl reload httpd

Step 1.4: Update php.ini file

Now time to increase values in php.ini file. Openphp.inifile:

nano /etc/php.ini

Change the following data:

file_uploads = On allow_url_fopen = On short_open_tag = On memory_limit = 512M upload_max_filesize = 128M max_execution_time = 3600

Then save thisphp.inifile.

After that, you should restart apache2. Run this command:

systemctl restart httpd

Step 2: Install Database Server

To install mySQL Server and Client, run this command line:...

立即注册
分享的网址网站均收集自搜索引擎以及互联网,非查问网运营,查问网并没有提供其服务,请勿利用其做侵权以及违规行为。

更新于:2021-12-15 18:03:56
    您需要登录后才可以评论。 立即注册
    相关内容

    阿里云香港轻量服务器LNMP搭建yum安装Centos Stream8全流程

    Centos7利用yum安装apache+mysql8+php7 一篇搞定!

    Centos 服务器搭建(Centos8服务器搭建遇到的各种问题及解决方法)

    Centos8 更新yum或安装软件时提示 Failed to download metadata for repo...

    从CentOS 8到CentOS Stream,到底发生什么事了?

    CentOS8出现“ Error: Failed to download metadata for repo ‘AppStrea...

    如何将CentOS 8转换为CentOS Stream(202205实测有效)

    Centos中查看nginx、apache、php、mysql配置文件路径

    Centos7 安装Apache过程详解

    推荐内容

    怎样使用V2Ray代理和SSTap玩如魔兽世界/绝地求生/LOL台服/战地3/黑色沙漠/彩...

    sstap游戏代理教程 从此玩如魔兽世界/绝地求生/LOL台服/战地3/黑色沙漠/彩虹六...

    BT磁力搜索网站汇总和找不到的资源

    什么是磁力链接,您如何使用?

    Z-Library:全球最大的数字图书馆/含打不开的解决方案/镜像

    使用V2Ray的mKCP协议加速游戏

    v2rayN已停止工作

    【车险课堂】什么是无赔款优待系数ncd,你“造”吗?