パッケージマネージャ(yum、rpm ...)なしでCentosにApacheとPHPをインストールする[閉じる]

パッケージマネージャ(yum、rpm ...)なしでCentosにApacheとPHPをインストールする[閉じる]

パッケージマネージャなしでCentosにApacheとPHPをインストールする方法を説明できる人はいますか?検索でこの文書のみが見つかりました。http://php.net/manual/fr/install.unix.apache.php

ベストアンサー1

コンパイルを開始する前に、追加のヘッダファイルとライブラリが必要です。次のコードを使用して前提条件をインストールします。新しいバージョンにアップグレードする場合は必須ですので、削除しないでください。

yum install make gcc automake zlib-devel bison cmake libtool wget gcc-c++ unzip ncurses-devel openssl-devel pcre-devel libxml2-devel curl-devel gd-devel libxslt-devel

Apacheをビルドしてインストールします。

wget http://ftp.itu.edu.tr/Mirror/Apache//httpd/httpd-2.2.25.tar.gz
tar zxvf httpd-2.2.25.tar.gz 
cd httpd-2.2.25 

通常、次のオプションが広く使用されています。

./configure \
        "--prefix=/etc/httpd" \
        "--exec-prefix=/etc/httpd" \
        "--bindir=/usr/bin" \
        "--sbindir=/usr/sbin" \
        "--sysconfdir=/etc/httpd/conf" \
        "--enable-so" \
        "--enable-dav" \
        "--enable-dav-fs" \
        "--enable-dav-lock" \
        "--enable-suexec" \
        "--enable-deflate" \
        "--enable-unique-id" \
        "--enable-mods-static=most" \
        "--enable-reqtimeout" \
        "--with-mpm=prefork" \
        "--with-suexec-caller=apache" \
        "--with-suexec-docroot=/" \
        "--with-suexec-gidmin=100" \
        "--with-suexec-logfile=/var/log/httpd/suexec_log" \
        "--with-suexec-uidmin=100" \
        "--with-suexec-userdir=public_html" \
        "--with-suexec-bin=/usr/sbin/suexec" \
        "--with-included-apr" \
        "--with-pcre=/usr" \
        "--includedir=/usr/include/apache" \
        "--libexecdir=/usr/lib/apache" \
        "--datadir=/var/www" \
        "--localstatedir=/var" \
        "--enable-logio" \
        "--enable-ssl" \
        "--enable-rewrite" \
        "--enable-proxy" \
        "--enable-expires" \
        "--with-ssl=/usr" \
        "--enable-headers"

ソースディストリビューションをビルドしてインストールするには、次のように入力します。

make
make install

ソースからPHPをビルドします。

wget http://us2.php.net/get/php-5.5.5.tar.gz/from/this/mirror
tar zxvf php-5.5.5.tar.gz
cd php-5.5.5
./configure \
        --with-apxs2 \
        --with-curl=/usr \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr \
        --with-freetype-dir=/usr \
        --with-kerberos \
        --with-openssl \
        --with-mcrypt=/usr/local/lib \
        --with-mhash \
        --with-mysql=mysqlnd \
        --with-mysqli=mysqlnd \
        --with-pcre-regex \
        --with-pear \
        --with-png-dir=/usr \
        --with-xsl \
        --with-zlib \
        --with-zlib-dir=/usr \
        --with-iconv \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-gd-native-ttf \
        --enable-soap \
        --enable-sockets \
        --enable-mbstring \
        --enable-zip \
        --enable-wddx
make
make install
libtool --finish /root/php-5.5.5/libs
cp php.ini-production /usr/local/lib/php.ini
sed -i 's/;date.timezone =.*/  date.timezone \= "Asia\/Calcutta"/' /usr/local/lib/php.ini

おすすめ記事