sudo apt-get install php5 php5-common php5-cli php5-dev php5-mysql phpmyadmin php5-pgsql phppgadmin php5-gd php5-mcrypt php5-curl php-pear libapache2-mod-php5 php5-xdebug php5-codesniffer
/usr/include/openssl/conf.h:132:7: note: expected 'struct lhash_st_CONF_VALUE *' but argument is of type 'int *'
make: *** [ext/openssl/openssl.lo] Error 1
mkdir -p ~/Downloads/php-5.2.17
cd ~/Downloads/php-5.2.17
wget museum.php.net/php5/php-5.2.17.tar.gz
tar zxf php-5.2.17.tar.gz
sudo apt-get install libxml2-dev libpcre3-dev libbz2-dev libcurl4-openssl-dev libdb4.8-dev libjpeg-dev libpng12-dev libxpm-dev libfreetype6-dev libmysqlclient-dev postgresql-server-dev-9.1 libt1-dev libgd2-xpm-dev libgmp-dev libsasl2-dev libmhash-dev unixodbc-dev freetds-dev libpspell-dev libsnmp-dev libtidy-dev libxslt1-dev libmcrypt-dev
Thank you for using php
$ apt-cache search libxml2 | grep dev
libcroco3-dev - Cascading Style Sheet (CSS) parsing and manipulation toolkit
libxml++2.6-dev - C++ interface to the GNOME XML library (libxml2)
libxml2-dev - Development files for the GNOME XML library
libgdome2-cpp-smart-dev - C++ bindings for GDome2 DOM implementation
libgdome2-dev - Development files for libgdome2
libgdome2-ocaml-dev - OCaml bindings for GDome2 DOM implementation
libgtkmathview-dev - rendering engine for MathML documents
libsp-gxmlcpp-dev - S+P C++ wrapper for Gnome libxml2/libxslt
sudo apt-get install libxml2-dev
configure: error: Could not find pcre.h in / usr
sudo apt-get install libpcre3-dev
configure: error: Please reinstall the BZip2 distribution
sudo apt-get install libbz2-dev
configure: error: Please reinstall the libcurl distribution - easy.h should be in / include / curl /
sudo apt-get install libcurl4-openssl-dev
configure: error: DBA: Could not find the necessary header file (s).
checking for db4 major version ... configure: error: Header contains different version
sudo apt-get install libdb4.8-dev
configure: error: libjpeg. (a | so) not found.
sudo apt-get install libjpeg-dev
configure: error: libpng. (a | so) not found.
sudo apt-get install libpng12-dev
configure: error: libXpm. (a | so) not found.
sudo apt-get install libxpm-dev
configure: error: freetype.h not found.
sudo apt-get install libfreetype6-dev
You need to install a client-side application for building a client-side application.
configure: error: Cannot find libpq-fe.h. Please specify the correct PostgreSQL installation path
sudo apt-get install postgresql-server-dev-9.1
checking for FreeType 1 support ... no - FreeType 2.x is used instead
configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.
sudo apt-get install libt1-dev
configure: error: Unable to find gd.h anywhere under / usr
sudo apt-get install libgd2-xpm-dev
configure: error: Unable to locate gmp.h
sudo apt-get install libgmp-dev
configure: error: Cannot find MySQL header files under / usr.
Note that the MySQL client library is not bundled anymore!
sudo apt-get install libmysqlclient-dev
configure: error: sasl.h not found!
sudo apt-get install libsasl2-dev
configure: error: Please reinstall libmhash - I cannot find mhash.h
sudo apt-get install libmhash-dev
checking for unixODBC support ... configure: error: ODBC header file '/usr/include/sqlext.h' not found!
sudo apt-get install unixodbc-dev
configure: error: Directory / usr is not a FreeTDS installation directory
sudo apt-get install freetds-dev
configure: error: Cannot find pspell
sudo apt-get install libpspell-dev
configure: error: SNMP sanity check failed. Please check config.log for more information.
sudo apt-get install libsnmp-dev
configure: error: Cannot find libtidy
sudo apt-get install libtidy-dev
configure: error: xslt-config not found. Please reinstall the libxslt> = 1.1.0 distribution
sudo apt-get install libxslt1-dev
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
sudo apt-get install libmcrypt-dev
configure: error: Cannot find OpenSSL's libraries
Add the following in the ./configure option:
--with-libdir = / lib / x86_64-linux-gnu
configure: error: You've configured extension pdo_sqlite to build it, but it depends on it. Pdo_sqlite shared or build pdo_sqlite
Add the following in the ./configure option
--with-pdo-sqlite=shared
--with-sqlite=shared
sudo make
ext / openssl / .libs / xp_ssl.o: In function `php_openssl_setup_crypto ':
ext / openssl / xp_ssl.c: 357: undefined reference to `SSLv2_server_method '
ext / openssl / xp_ssl.c: 337: undefined reference to `SSLv2_client_method '
This is related to bug # 54736 which are easily solved by applying the patch attached to this bug report.
Download this patch to the ~ / Downloads / php-5.2.17 folder and do the following:
patch -p1 < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch.patch
You should see a message about the successful application of the patch, like this:
patching file ext/openssl/xp_ssl.c
Hunk #1 succeeded at 332 (offset 4 lines).
Hunk #2 succeeded at 354 (offset 4 lines).
Hunk #3 succeeded at 583 (offset -50 lines).
Hunk #4 succeeded at 819 (offset -98 lines).
ext / gmp / gmp.c: In function 'zif_gmp_random':
ext / gmp / gmp.c: 1399: 69: error: '__GMP_BITS_PER_MP_LIMB' undeclared (first use in this function)
ext / gmp / gmp.c: 1399: 69: note: it appears
It's time to fix bug # 50990
In one of the comments on gmail dot com susan dot, the following working solution is proposed, which does the magic:
I solved the problem by replacing the outdated constant definition __GMP_BITS_PER_MP_LIMB with GMP_LIMB_BITS , which is present in all previous versions and MPIR defines too.
You need to edit the ext / gmp / gmp.c file and replace __GMP_BITS_PER_MP_LIMB with GMP_LIMB_BITS. In my case it was line 1399.
ext / zip / lib / .libs / zip_dirent.o: In function `memset ':
/usr/include/x86_64-linux-gnu/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters
The last bug is # 53568 that fixes pretty easily: open ext / zip / lib / zip_dirent.c and replace line 478:
memset(&tm, sizeof(tm), 0);
on
memset(&tm, 0, sizeof(tm));
No more mistakes!
sudo make install
sudo checkinstall
sudo ln -s /etc/php5/conf.d /etc/php52
sudo ln -s /etc/php5/cli /etc/php52
sudo cp php.ini-recommended /etc/php52/apache2/php.ini
sudo apt-get install libapache2-mod-fastcgi
sudo a2enmod cgi fastcgi actions
sudo service apache2 restart
#!/bin/sh
PHPRC="/etc/php52/apache2/"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php52/php-cgi
sudo chmod +x /usr/lib/cgi-bin/php52-cgi
# Include file for virtual hosts that need to run PHP 5.2
<FilesMatch "\.php">
SetHandler application/x-httpd-php5
Include php52.conf
sudo service apache2 reload
Source: https://habr.com/ru/post/176147/