Info

1. 各ソフトウェア確認
$ perl -v
This is perl, v5.10.0 built for darwin-thread-multi-2level

$ php -v
PHP 5.3.0 (cli) (built: Jul 19 2009 00:34:29)

$ python -V
Python 2.6.1

2. confファイル修正
$ sudo vi /private/etc/apache2/httpd.conf

#コメントを外す(php用)
LoadModule php5_module libexec/apache2/libphp5.so

#コメントを外す(perl, python CGI用)
AddHandler cgi-script .cgi

$ sudo vi /private/etc/apache2/users/{username}.conf
# ExecCGI追加

<Directory "/Users/{username}/Sites/">
    #Options Indexes MultiViews
    Options Indexes MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

 
3. 確認

perl.cgi

#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach(sort keys %ENV){
    print "$_: $ENV{$_}
\n"; }

python.cgi

#!/usr/bin/python
import os
print "Content-type: text/html\n\n";
for param in os.environ.keys():
  print "%20s %s<br/>" % (param,os.environ[param])

test.php

<?php
    phpinfo();
?>

Comments

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS