[未完成] 阿里云新装PHP环境


修正 php session

先去TMP下建个目录 加权

chgrp -R www /tmp/php_session  
chmod -R 777 /tmp/php_session  

再修改php.ini

session.save_path = "/tmp/php_session"
session.auto_start = 0 为 session.auto_start = 1  
output_buffering=off 改为on  

重启php-fpm生效

service php-fpm restart  

disable opcache

如果是Zend OPCache

[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=0
; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=0

如果是apcu

打开文件 gedit /usr/local/php/etc/php.d/ext-apcu.ini

[apcu]
extension=apcu.so
apc.enabled=0
apc.shm_size=32M
apc.ttl=7200
apc.enable_cli=0

开放端口

打开文件 vi /etc/sysconfig/iptables

# Generated by iptables-save v1.4.21 on Fri Nov 23 14:13:19 2018
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1:152]
:syn-flood - [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3000 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 20000:30000 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
COMMIT
# Completed on Fri Nov 23 14:13:19 2018

生效

service iptables restart
Redirecting to /bin/systemctl restart iptables.service

请先后发表评论
  • 最新评论
  • 总共0条评论