PHP 5.3 auf CentOS kompilieren

Ich nutze den Standard Http Apache und MySQL Server auf einem neu installiertem Centos 5.6 64 Bit System.

Update das System auf den aktuellsten Stand:

 yum update

Installiere alle benötigten Devel’s und Programme:

 yum install libxslt-devel xslt-devel aspell-devel libmcrypt-devel bzip2-devel httpd-devel gcc make automake curl-devel freetype-devel libpng-devel gd-devel gmp-devel libjpeg-devel openssl-devel pcre-devel zlib-devel unixODBC-devel sqlite-devel libxml2-devel mysql-devel net-snmp-devel pcre-devel

Besorge das aktuellste PHP 5.3 von http://www.php.net/downloads.php.

 cd /tmp
 wget php-source
 tar xvfj php-version
 rm php-version

Erzeuge die install config:

 cd php-Version
 vi install-sh

Drücke i und kopiere folgendes in das File:

 ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix=\
  --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share\
  --includedir=/usr/include --libdir=/usr/ --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com\
  --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc\
  --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --with-pear --with-bz2 --with-curl\
  --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext\
  --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-pspell --with-libexpat-dir=/usr --with-pcre-regex=/usr\
  --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem\
  --enable-sysvshm --enable-sysvmsg --enable-wddx --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr\
  --enable-shmop --enable-calendar --with-mime-magic=/usr/share/file/magic.mime --without-sqlite --with-libxml-dir=/usr\
  --enable-xml --enable-force-cgi-redirect --enable-pcntl --enable-mbstring=shared\
  --enable-mbregex --with-ncurses=shared --with-gd=shared --enable-bcmath=shared --enable-dba=shared --with-db4=/usr\
  --with-xmlrpc=shared --with-mysql=shared,/usr \
  --enable-dom=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr\
  --enable-xmlreader=shared --enable-xmlwriter=shared --enable-fastcgi --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,/usr\
  --with-pdo-sqlite=shared,/usr --enable-dbase=shared\
  --with-pdo-mysql=shared,/usr/ --with-mysql-sock=/var/lib/mysql/mysql.sock \
  --with-mcrypt --with-apxs2=/usr/sbin/apxs --enable-static=no

Drücke Escape um den Text-Module zu verlassen und speichere schließe die Datei:

 : x

Gib die passenden Rechte auf install-sh:

 chmod 755 install-sh

Starte configure:

 ./install-sh

Wenn irgendetwas fehlt versuche das fehlende Programm mit “yum search” zu finden, in der Regel handelt es sich um ein -devel. Installiere es danach mit “yum install” nach. Führe ./install-sh wieder aus.
Wenn das Problem nach wie vor nicht gelöst ist prüfe ob du etwas in config.log findest und/oder suche in Google. Üblicherweise stehst du selten mit dem Problem alleine und es gibt bereits Hilfe.

Wenn alles passt, starte make und installiere PHP:

 make
 make install

Das war’s. Du hast jetzt eine laufende aktuelle selbstkompilierte PHP Version auf deinem Server.

;)

Be Sociable, Share!
  • jacksprat // 27th Juli, 2011 at 18:09

    This helped me fix an error during compile of php 5.3.6.. Works well !
    Thanks.

POST A COMMENT

  • You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>