CentOS 7 搭建开源商城 prestashop

通过上面的地址:在第3步:命令sudo yum install nginx php php-fpm 之后进行不下去了 英文版教程 nginx-release-centos.noarch

centOS 查找资源安装

yum list httpd*查找资源;
yum install httpd-devel.版本号

共享文件夹 sudo mount -t vboxsf osshare /media/osshare

MySQL

1.安装mysql

wget -i -c https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum -y install mysql80-community-release-el7-1.noarch.rpm
yum -y install mysql-community-server

2.查看初始化密码

grep "password" /var/log/mysqld.log

2018-07-18T04:38:24.043225Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Gua<TuiB6ty:

3.用下面的命令启动mysql 4.用初始化密码登录修改密码

 mysql -uroot -phDuPegVtk1+T


 ALTER USER 'root'@'localhost' IDENTIFIED BY 'Huanghui@0369';

mysql 登录命令

mysql -uroot -pHuanghui@0369

1.启动命令

[root@xufeng Desktop]# service mysqld start
Redirecting to /bin/systemctl start  mysqld.service

2.关闭命令

[root@xufeng ~]# service mysqld stop
Redirecting to /bin/systemctl stop  mysqld.service

3.重启命令

[root@xufeng ~]# service mysqld restart
Redirecting to /bin/systemctl restart  mysqld.service

4.查看服务状态

service mysqld status

5.登录Mysql

mysql -uroot -p

6.开启远程连接 开放MySQL访问端口3306, 停止防火墙,并设置为不可用

systemctl stop firewalld.service && systemctl disable firewalld.service

安装iptables

yum install iptables-services 

systemctl stop iptables && systemctl disable iptables
systemctl start iptables && systemctl enable iptables

修改防火墙配置文件CentOS7安装iptables防火墙

vi /etc/sysconfig/iptables

加入端口配置

开放3306端口 
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT

重新加载规则

service iptables restart

登录mysql

use mysql

update user set host='%' where user='root';

GRANT ALL ON *.* TO 'root'@'%';

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Huanghui@0369';

FLUSH PRIVILEGES
```
重启mysql,命令看上面

#配置Web服务器
检查是否安装了nginx
```
find -name nginx 
```
查看nginx进程
```
ps aux|grep nginx
```
卸载nginx命令
```
yum remove nginx  
```
###nginx安装:
#[nginx 安装](https://www.cnblogs.com/kaid/p/7640723.html)
1.开始安装
```
yum install nginx
```

3.查询nginx进程:
```
ps aux|grep nginx
```



4 打开nginx配置文件,添加如下配置
```
http {

   include /etc/nginx/mime.types;
   default_type application/octet-stream;



    server{
        listen       80;
        server_name  localhost;
        root /var/www/html;
        index  index.php;

        location / {
                try_files $uri $uri/ /index.php;
        } 
        location ~ \.php {
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
                #用于php反向代理,解决nginx 504错误
                #以fastcgi_*配置项是php用的
                fastcgi_connect_timeout 1000;
                fastcgi_send_timeout 1000;
                fastcgi_read_timeout 1000;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 8 128k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 128k;
                fastcgi_intercept_errors on;
        }
    }
}
```

5 在目录/var/www/html目录中添加测试文件index.php,编辑如下信息:

// index.php <?php phpinfo() ?>


3、启动Nginx并设置开机自动运行
```
 systemctl start nginx.service
 systemctl restart nginx.service
 systemctl enable nginx.service
``` 
4、查看nginx进程
```
ps -ef |grep nginx
```

#[centos安装PHP7.3]()
1.[新linux服务器需要安装的模块](https://blog.csdn.net/m0_37886429/article/details/78855165)

2. [安装参考](https://segmentfault.com/a/1190000017547464?utm_source=tag-newest)

进入解压目录
```
 cd /usr/local/php7.3/php-7.3.0 
  cd /usr/local/
```
执行安装配置
```
./configure --enable-fpm --prefix=/usr/local/php7.3 --with-config-file-path=/usr/local/php7.3/etc --with-apxs2=/usr/local/apache/bin/apxs --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-openssl --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip

```

3. [安装完之后参考](https://blog.csdn.net/anzhen0429/article/details/79272893)
(https://blog.csdn.net/sinat_32829963/article/details/81558483)


#CentOS7 安装 PHP7.2
安装 EPEL 软件包:

$ yum install epel-release

安装 remi 源:
```
 yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

安装 yum 扩展包:

 yum install yum-utils
`

启用 remi 仓库:

yum-config-manager --enable remi-php72
yum update
`

安装 PHP 服务 安装 PHP7,2

yum install php72
```
输入 php72 -v 查看安装结果

安装 php-fpm 和一些其他模块:
```
yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache

```
php-fpm 服务
设置开机自启

service php-fpm enable systemctl enable php-fpm.service

常用 php-fpm 命令
1 开启服务

service php-fpm start

service php-fpm restart

systemctl start php72-php-fpm.service systemctl restart php72-php-fpm.service

2 停止服务
```

service php-fpm stop
systemctl stop php72-php-fpm.service
```
3 查看状态 
```
service php-fpm status
systemctl status php72-php-fpm.service

4 查看php进程

ps -ef | grep php

[centos下配置nginx支持php]这个很重要(https://www.cnblogs.com/mitang/p/5524540.html)

安装zhe'ge ZIP扩展

执行这句话安装OpenSSL:

yum -y remove libzip-devel
wget https://libzip.org/download/libzip-1.3.2.tar.gz
tar xvf libzip-1.3.2.tar.gz
cd libzip-1.3.2
./configure
make -j 4
make install

[然后安装zip](http://www.cnblogs.com/hltswd/p/7039766.html)

cd /usr/local/src

wget http://pecl.php.net/get/zip-1.15.4.tgz  

tar -zxvf zip-1.15.4.tgz  

cd zip-1.15.4  

/usr/bin/phpize # 根据自己安装的路径变更,find / -name phpize

./configure --with-php-config=/usr/bin/php-config  #根据自己安装的路径变更,find / -name   php-config 如果没有这个文件执行:yum install php-devel



make 

make test

make install
`

如果没有报错这样就安装完成了,用命令查看一下看有没有zip.so

ls /opt/remi/php70/root/usr/lib64/php/modules/

最后在php.ini里修改以下两项find / -name php.ini

1)zlib.output_compression = Off 改为 zlib.output_compression = On

2)增加extension=/usr/lib64/php/modules/zip.so

重启php-fpm

systemctl restart php72-php-fpm.service

PHP-curl扩展

1.下载地址 https://curl.haxx.se/download/ 解压到



安装prestashop

1 安装前确认数据库已经创建 2 授予PHP安装目录/var/www/html/权限

------chgrp -R apache /var/www/html/
chgrp -R nginx /var/www/html/

--chgrp -R apache /usr/share/nginx/html

---chmod 777 /var/www/html/ -R
chmod 775 /var/www/html/ -R

---chmod -R -777 /usr/share/nginx/html
--chmod  -777 /var/www/html/
--chmod  -755 /var/www/html/

[root@localhost html]# chmod  -R 777  config
[root@localhost html]# chmod  -R 777  cache
[root@localhost html]# chmod  -R 777  classes
[root@localhost html]# chmod  -R 777  log
chmod: 无法访问"log": 没有那个文件或目录
[root@localhost html]# chmod  -R 777  img
[root@localhost html]# chmod  -R 777  mails
[root@localhost html]# chmod  -R 777  modules
[root@localhost html]# chmod  -R 777  translations
[root@localhost html]# chmod  -R 777  upload
[root@localhost html]# chmod  -R 777  download
`

加速

https://www.prestashop.com/forums/topic/460749-%E8%AF%B7%E6%95%99%E5%90%84%E4%BD%8Dprestashop%E8%BD%BD%E5%85%A5%E9%80%9F%E5%BA%A6%E7%9A%84%E9%97%AE%E9%A2%98/?tab=comments

results matching ""

    No results matching ""