バーチャルホストでPHPのバージョン分けて起動する方法完結。

2017.09.28

Logging


バーチャルホストでPHPのバージョン分けて起動する方法完結。
うまくいかない状態の理由がわかりました。
パスが間違っていたということで昨日からタイムゾーン設定がうまく機能しなかった。
ただそれだけでした・・・とほほ?(´・ω・`)
php-cgi + ソースなどと検索するとインストール方法などが
掲載しているサイトがあるので、ググってみると参考になります。
今回、PHP5.6のバージョンをダウンロードしてきてコンパイルして
うまくファイルが作れる場合は上記のような画面が表示されます。
それ以外はエラーですので
その後、make && make install を行なっても反映はされません。
こういう感じで記述するとうまくいきますよ。
あくまでも例ですのでご自分の環境にパスなどは変更を
行なってください。

./configure  \
  --prefix=/home/www/php-5.6.31  \
    --with-config-file-path=/home/www/php-5.6.31 \
    --with-config-file-scan-dir=/home/www/php-5.6.31 \
    --enable-mbstring \
    --enable-zip \
    --enable-bcmath \
    --enable-pcntl \
    --enable-ftp \
    --enable-exif \
    --enable-calendar \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-wddx \
    --enable-mbregex \
    --with-openssl \
    --with-mysql \
    --with-mysqli \
    --with-pdo-mysql \
    --with-mysql-sock=/var/lib/mysql/mysql.sock \
    --with-curl \
    --with-mcrypt \
    --with-iconv \
    --with-gmp \
    --with-gd \
    --with-jpeg-dir \
    --with-png-dir \
    --with-jpeg-dir=/home/www/php-5.6.31/img/jpeg \
    -with-freetype-dir=/home/www/php-5.6.31/img/freetype
<Directory "/home/www/cgi-bin">
    AllowOverride All
    Options FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>
Action php-cgi-5.6.31 /cgi-bin/php-cgi-5.6.31
<Directory "/home/www/html/home.site">
    Options +ExecCGI
    AddHandler php-cgi-5.6.31 .php .html
</Directory>

シンボリックリンクなどの設定は割愛します。
また、コンパイルするとbin/の配下にphp-cgiファイル出来ますので
そちらとシンボリックリンクさせて無いといけませんのでご注意を!!
そしてvim /etc/httpd/conf/httpd.confでCGIが使用出来るように設定しているかも
チェックが必要となります:D
その他・・・注意事項
PHPの解凍フォルダのパーミッションの権限をApacheへ
seLinuxを無効化しているかなどのチェック。
以上、まとまりのない設定方法のアドバイスになりました・・・が
これで以上となります。
分かっている人にはおそらく伝わる内容だと思います。

タグ

Action php-cgi-5.6.31, AddHandler php-cgi-5.6.31, Allow from all, AllowOverride All, AM, Directory&gt, enable-calendar, enable-mbregex, enable-mbstring, enable-sysvmsg, enable-sysvsem, enable-sysvshm, Options FollowSymLinks, php-5.6.31, with-config-file-path, with-config-file-scan-dir, with-freetype-dir, with-jpeg-dir, with-mysql-sock, with-pdo-mysql,