Situatie
Cum sa instalezi PHP din surse.
Solutie
Pasi de urmat
root@bsdpc[~/work] # wget http://ro.php.net/distributions/php-7.2.22.tar.bz2
root@bsdpc[~/work] # tar jxvf php-7.2.22.tar.bz2
root@bsdpc[~/work] # cd php-7.2.22/
root@bsdpc[~/work/php-7.2.22] # ./configure –with-mysql=/usr/local/mysql/ \
2> –with-apxs2=/usr/local/apache2/bin/apxs \
2> –with-openssl –with-bz2 –enable-ftp \
2> –enable-mbstring –enable-bcmath –enable-calendar \
2> –enable-mbregex –enable-magic-quotes \
2> –with-pear –enable-sockets
root@bsdpc[~/work/php-7.2.22] # make
root@bsdpc[~/work/php-7.2.22] # make install
root@bsdpc[~/work/php-7.2.22] # libtool –finish /usr/home/work/php-7.2.22/libs
root@bsdpc[~/work/php-7.2.22] # cp php.ini-production /usr/local/lib/php.ini
root@bsdpc[~/work] # tar jxvf php-7.2.22.tar.bz2
root@bsdpc[~/work] # cd php-7.2.22/
root@bsdpc[~/work/php-7.2.22] # ./configure –with-mysql=/usr/local/mysql/ \
2> –with-apxs2=/usr/local/apache2/bin/apxs \
2> –with-openssl –with-bz2 –enable-ftp \
2> –enable-mbstring –enable-bcmath –enable-calendar \
2> –enable-mbregex –enable-magic-quotes \
2> –with-pear –enable-sockets
root@bsdpc[~/work/php-7.2.22] # make
root@bsdpc[~/work/php-7.2.22] # make install
root@bsdpc[~/work/php-7.2.22] # libtool –finish /usr/home/work/php-7.2.22/libs
root@bsdpc[~/work/php-7.2.22] # cp php.ini-production /usr/local/lib/php.ini
Editati fisierul de configurare al serverului WEB Apache si adaugati urmatoarele linii:
LoadModule php5_module modules/libphp5.so #### De obicei aceasta linie este deja adaugata prin procesul make install
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Restartam serverul Apache si verificam incarcarea modului php7_module:
root@bsdpc[~/work/php-7.2.22] # /etc/rc.d/httpd restart
root@bsdpc[~/work/php-7.2.22] # /usr/local/apache2/bin/httpd -M |grep php
php5_module (shared)
Syntax OK
root@bsdpc[~/work/php-7.2.22] #
root@bsdpc[~/work/php-7.2.22] # /usr/local/apache2/bin/httpd -M |grep php
php5_module (shared)
Syntax OK
root@bsdpc[~/work/php-7.2.22] #
Leave A Comment?