php 5.3.9 de トラブル

CONTENTS


Lastmodified 2023-10-24 (火) 14:48:21


.php にアクセスするとダウンロードになる!

pkgng へ移行して、pkg upgrade した後、.php ファイルへアクセスすると、ダウンロードになるようになったった。

まぁ、良くあるトラブルではあるが、思わぬ原因だったんで、φ(..)メモメモ

pkg upgrade した場合、Apacheやphpなどもupgradeされるが、lang/php5 のinstall オプションの mod_php5 が外されているとのこと。

# portupgrade lang/php5
[Reading data from pkg(8) ... - 284 packages found - done]
** Port marked as IGNORE: lang/php5:
        doesn't install the Apache module anymore: update your OPTIONS and build www/mod_php5 port instead
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - lang/php5 (marked as IGNORE)

ということなので・・・

# pkg install www/mod_php5
Updating repository catalogue
The following 1 packages will be installed:

        Installing mod_php5: 5.4.27_1,1

The installation will require 4 MB more space

1 MB to be downloaded

Proceed with installing packages [y/N]: y
mod_php5-5.4.27_1,1.txz                 100% 1060KB   1.0MB/s 750.0KB/s   00:01
Checking integrity... done
[1/1] Installing mod_php5-5.4.27_1,1...[activating module `php5' in /usr/local/etc/apache22/httpd.conf]
 done
***************************************************************

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file: 

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

***************************************************************
#
# apachectl restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 2232.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.

で、OK!

www/mod_php5 2014/08/28

===>   Registering installation for mod_php5-5.4.32,1
[activating module `php5' in /usr/local/etc/apache24/httpd.conf]
***************************************************************

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

***************************************************************

Total access 4000:本日 1:昨日 0

Counter: 4000, today: 1, yesterday: 0

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS