» centos の記事

~ Centos7 php7 install pThread ~

connie 2017.03.30 | centos, php | | No Comments
yum install gcc php70w-devel

git clone https://github.com/krakjoe/pthreads.git
cd pthreads
zts-phpize
./configure --with-php-config=/usr/bin/zts-php-config
make

cp modules/pthreads.so /usr/lib64/php-zts/modules/
nano /etc/php-zts.d/pthreads.ini
extension=pthreads.so

Testing for Thread Safety enable

/etc/php-zts.d/pthreads.ini

Should see those thing below
Thread Safety => enabled
pthreads

Execute server-side Script

zts-php -q ws_server.php

instead of using 
php -q 

 

~ centos epel error ~

connie 2016.11.07 | centos | | No Comments
yum check-update(如果有問題)
yum --disablerepo="epel"  check-update(而尼個無問題)

可以log error 去txt

URLGRABBER_DEBUG=1 yum check-update 2> debug.log

如見到有CA cert問題,方法係斬左舊有既CA cert再reinstall 新的
(但因為epel error ,所以必去用disable mode 尼del

yum --disablerepo="epel" reinstall ca-certificates
yum --disablerepo="epel" update ca-certificates

然後再 yum check-update 看看

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

nano /etc/yum.repos.d/epel.repo

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

uncomment baseurl and comment mirror

mysqladmin -u root -p var | grep -E 'character|collation' | tr -s ' '
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
nano  /etc/my.cnf
[mysqld]
...
...
character-set-server=utf8
systemctl stop mariadb
systemctl start mariadb
mysqladmin -u root -p var | grep -E 'character|collation' | tr -s ' '
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |

 

~ centos setting GEOIP ~

connie 2016.05.06 | centos, php | | No Comments
yum install GeoIP-devel
yum install php-pear
yum install php-pecl-geoip

cd /usr/share/GeoIP
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoLiteCity.dat.gz
mv GeoLiteCity.dat GeoIPCity.dat

sudo systemctl restart php-fpm
sudo systemctl restart nginx

TEST PHP CODE

$record = geoip_record_by_name($_SERVER["REMOTE_ADDR"]);
    if ($record) {
        print_r($record);
    }

 

去/etc/httpd.conf uncomment 這句

NameVirtualHost *:80

service httpd restart

~ nginx+php No input file specified problem ~

connie 2013.04.14 | centos | | No Comments
nano /etc/nginx/conf.d/default.conf
location ~ \.php$ {
        root           /usr/share/nginx/html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

將fastcgi_param 改為

fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
service nginx restart

完成

yum --enablerepo=remi install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-soap 

 

Checking Version

cat /etc/*release*

Update Version

yum list updates
yum update
reboot

 

~ Activate the network card in centos ~

connie 2013.04.10 | centos | | No Comments
vi /etc/sysconfig/network-scripts/ifcfg-eth0

按Insert 變edit mode

DEVICE=eth0                         //網路卡名稱
BOOTPROTO=static                    //BOOTP協定
BROADCAST=192.168.202.255           //廣播 IP Address
HWADDR=00:15:C5:E5:99:B1            //MAC Address
IPADDR=192.168.202.100              //IP Address
NETMASK=255.255.254.0               //Netmask (遮罩)
NETWORK=192.168.202.0               //網段
ONBOOT=no                        //開機自動啟動

將最後一行變成

ONBOOT=yes                        //開機自動啟動
reboot

 

« Previous Page | HOME | Next Page »

Smiley face

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930