Skip to content

Instantly share code, notes, and snippets.

@MaximStrutinskiy
Last active December 22, 2017 09:09
Show Gist options
  • Save MaximStrutinskiy/204de864f43bf12c8b9514686380885b to your computer and use it in GitHub Desktop.
Save MaximStrutinskiy/204de864f43bf12c8b9514686380885b to your computer and use it in GitHub Desktop.
1) download php source from official site (example: wget -O php-5.3.29.tar.gz http://us.php.net/get/php-5.3.29.tar.gz/from/this/mirror)
2) extract to you folder (extract php-X-X-X.tar.gz to your folder)
3) cd to folder (move to php folder)
4) ./configure --with-apxs2=/usr/bin/apxs (add your custome configuration)
./configure --with-apxs2=/usr/bin/apxs --cache-file=/home/andersen/php-5.3.29 --with-config-file-path=/home/andersen/php-5.3.29/etc --with-config-file-scan-dir=/home/andersen/php-5.3.29/var/db --disable-all --enable-phar --enable-session --enable-short-tags --enable-tokenizer --with-pcre-regex --with-zlib=/usr --enable-pdo --enable-cli --enable-opcache --enable-dom --enable-libxml --enable-simplexml --enable-xml --enable-xmlreader --enable-xmlwriter --with-xsl --with-libxml-dir=/usr --enable-soap --enable-session --with-iconv --enable-hash --enable-debug --enable-bcmath --with-bz2=/usr --enable-calendar --enable-ctype --enable-dom --enable-fileinfo --with-libdir=lib/x86_64-linux-gnu --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --enable-filter --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-json --enable-mdregex --enable-mbstring --with-mhash=/urs --with-mcrypt=/usr --enable-pcntl --with-pcre-regen --with-pcre-dir=/usr --with-pear=/home/andersen/php-5.3.29/lib/php/pear --enable-phar --enable-posix --with-readline=/usr --enable-sockets --enable-tokenizer --with-curl=/usr --enable-zip --enable-zend-multibyte --with-gd --with-jpeg-dir=DIR --with-freetype-dir=/usr/include/freetype2 --with-openssl --with-openssl-dir=/usr/lib/ssl
5) make (make php)
6) make test (test php)
7) make install (install php)
8) add file etc/php.ini and add to php.ini content:
upload_max_filesize = 5M
mbstring.func_overload=2
mbstring.internal_encoding=utf-8
After this comands in you dir `/usr/lib/apache2/modules` you can find you libphpX.so file like "libphp5.so",
and you need customize your mode-avaliable files to this file:
- add phpX.load (you can copy/past from exsisting files)
- add phpX.conf (add line to your libphpX.so, example: `LoadModule php7_module /usr/lib/apache2/modules/libphp7.0.so`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment