rocky linux에서 php 5.6버전을 comfile을 진행하다 보면 openssl 버전 이슈로 인해 설치가 진행이 되지 않는다
그러면 remi yum repo를 이용해서 php 5.6버전을 설치 진행할 수 있다
1. mysql 설치
1 |
[root@localhost ~]# yum install mariadb mariadb-devel mariadb-server |
2. httpd 설치
1 |
[root@localhost ~]# yum -y install httpd httpd-devel |
3. php5.6 설치를 위한 remi yum repo 추가
1 |
[root@localhost ~]# yum install http://rpms.remirepo.net/enterprise/remi-release-8.rpm |
4. php56 설치
1 2 3 4 |
[root@localhost ~]# yum -y install php56-runtime php56-php-fpm php56-php-process php56-php-gd php56-php-common \ > php56-php-gmp php56-php-pecl-zip php56-php-pear php56-php-mysqlnd \ > php56-php-mbstring php56-php-cli php56-php-mcrypt php56-php-pecl-jsonc \ > php56-php php56-php-dba php56-php-xml php56-php-pdo |
6. 연결방식 설정
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@localhost ~]# vi /etc/opt/remi/php56/php-fpm.d/www.conf user = apache group = apache ;socket connect listen = /var/opt/remi/php56/run/php-fpm/www.sock listen.allowed_clients = 127.0.0.1 pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 35 ;pm.process_idle_timeout = 10s; ;pm.max_requests = 500 |
5-1. php.ini 수정
1 2 3 |
[root@localhost ]# vi /etc/opt/remi/php56/php.ini short_open_tag = On |
6. 서비스 등록
1 2 |
[root@localhost ~]# systemctl enable php56-php-fpm.service Created symlink /etc/systemd/system/multi-user.target.wants/php56-php-fpm.service → /usr/lib/systemd/system/php56-php-fpm.service. |
7. php-fpm 시작 및 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@localhost ~]# systemctl start php56-php-fpm.service ### 상태확인 [root@localhost ~]# systemctl status php56-php-fpm.service ● php56-php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php56-php-fpm.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2023-09-27 10:50:09 KST; 15s ago Main PID: 31473 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" Tasks: 6 (limit: 23133) Memory: 11.8M CGroup: /system.slice/php56-php-fpm.service ├─31473 php-fpm: master process (/etc/opt/remi/php56/php-fpm.conf) ├─31474 php-fpm: pool www ├─31475 php-fpm: pool www ├─31476 php-fpm: pool www ├─31477 php-fpm: pool www └─31478 php-fpm: pool www |
8. apache 서비스 등록 및 시작
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
### 서비스 등록 [root@localhost ~]# systemctl enable httpd Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service. ### 서비스 시작 [root@localhost ~]# systemctl start httpd ### 확인 [root@localhost ~]# systemctl status ● localhost.localdomain State: running Jobs: 0 queued Failed: 0 units Since: Thu 2023-09-21 01:32:34 KST; 6 days ago |
9. 웹페이지에서 phpinfo 호출
1 2 3 4 5 |
[root@localhost ~]# vi /var/www/html/index.php <? phpinfo(); ?> |