Skip to content

Commit

Permalink
Add php-opcache
Browse files Browse the repository at this point in the history
	Fix "can't switch to php 5.4 5.5"
  • Loading branch information
jason-chang committed Jul 28, 2016
1 parent 0e7ee0b commit e4e0b15
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions scripts/php/php54.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# 检测是否需要安装
if [ -f /home/vagrant/.env/php56 ]
if [ -f /home/vagrant/.env/php54 ]
then
exit 0
fi
Expand All @@ -13,7 +13,7 @@ sudo /bin/bash /home/vagrant/.remove/php.sh
yum install -y php php-devel php-fpm php-mysql php-pgsql php-imap php-ldap \
php-pear php-xml php-mbstring php-mcrypt php-bcmath \
php-mhash php-redis php-memcached php-xdebug php-curl \
php-imagick php-gd php-openssl php-readline --enablerepo=remi
php-imagick php-gd php-openssl php-readline php-opcache --enablerepo=remi

# 建立 环境标识
rm -rf /home/vagrant/.env/php*
Expand All @@ -30,6 +30,7 @@ sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php.ini
sed -i "s/;date.timezone.*/date.timezone = Asia\/Shanghai/" /etc/php.ini
sed -i "s/opcache.enable=1/opcache.enable=0/" /etc/php.d/opcache.ini

# Xdebug设置
sed -i '$ixdebug.remote_enable = ON' /etc/php.d/xdebug.ini
Expand Down
5 changes: 3 additions & 2 deletions scripts/php/php55.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# 检测是否需要安装
if [ -f /home/vagrant/.env/php56 ]
if [ -f /home/vagrant/.env/php55 ]
then
exit 0
fi
Expand All @@ -13,7 +13,7 @@ sudo /bin/bash /home/vagrant/.remove/php.sh
yum install -y php php-devel php-fpm php-mysql php-pgsql php-imap php-ldap \
php-pear php-xml php-mbstring php-mcrypt php-bcmath \
php-mhash php-redis php-memcached php-xdebug php-curl \
php-imagick php-gd php-openssl php-readline --enablerepo=remi-php55
php-imagick php-gd php-openssl php-readline php-opcache --enablerepo=remi-php55

# 建立 环境标识
rm -rf /home/vagrant/.env/php*
Expand All @@ -30,6 +30,7 @@ sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php.ini
sed -i "s/;date.timezone.*/date.timezone = Asia\/Shanghai/" /etc/php.ini
sed -i "s/opcache.enable=1/opcache.enable=0/" /etc/php.d/opcache.ini

# Xdebug设置
sed -i '$ixdebug.remote_enable = ON' /etc/php.d/xdebug.ini
Expand Down
3 changes: 2 additions & 1 deletion scripts/php/php56.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sudo /bin/bash /home/vagrant/.remove/php.sh
yum install -y php php-devel php-fpm php-mysql php-pgsql php-imap php-ldap \
php-pear php-xml php-mbstring php-mcrypt php-bcmath \
php-mhash php-redis php-memcached php-xdebug php-curl \
php-imagick php-gd php-openssl php-readline --enablerepo=remi-php56
php-imagick php-gd php-openssl php-readline php-opcache --enablerepo=remi-php56

# 建立 环境标识
rm -rf /home/vagrant/.env/php*
Expand All @@ -30,6 +30,7 @@ sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php.ini
sed -i "s/;date.timezone.*/date.timezone = Asia\/Shanghai/" /etc/php.ini
sed -i "s/opcache.enable=1/opcache.enable=0/" /etc/php.d/10-opcache.ini

# Xdebug设置
sed -i '$ixdebug.remote_enable = ON' /etc/php.d/15-xdebug.ini
Expand Down
3 changes: 2 additions & 1 deletion scripts/php/php70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sudo /bin/bash /home/vagrant/.remove/php.sh
yum install -y php php-devel php-fpm php-mysql php-pgsql php-imap php-ldap \
php-pear php-xml php-mbstring php-mcrypt php-bcmath \
php-mhash php-redis php-memcached php-xdebug php-curl \
php-imagick php-gd php-openssl php-readline --enablerepo=remi-php70
php-imagick php-gd php-openssl php-readline php-opcache --enablerepo=remi-php70

# 建立 环境标识
rm -rf /home/vagrant/.env/php*
Expand All @@ -30,6 +30,7 @@ sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php.ini
sed -i "s/;date.timezone.*/date.timezone = Asia\/Shanghai/" /etc/php.ini
sed -i "s/opcache.enable=1/opcache.enable=0/" /etc/php.d/10-opcache.ini

# Xdebug设置
sed -i '$ixdebug.remote_enable = ON' /etc/php.d/15-xdebug.ini
Expand Down
2 changes: 1 addition & 1 deletion scripts/remove/php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
yum remove -y php php-devel php-fpm php-mysql php-pgsql php-imap php-ldap \
php-pear php-xml php-mbstring php-mcrypt php-bcmath \
php-mhash php-redis php-memcached php-xdebug php-curl \
php-imagick php-gd php-openssl php-readline
php-imagick php-gd php-openssl php-readline php-opcache

0 comments on commit e4e0b15

Please sign in to comment.