読者です 読者をやめる 読者になる 読者になる

肉とビールとパンケーキ by @sotarok

少し大人になった「肉とご飯と甘いもの」

OpenSolaris の環境構築その2.Apache と PHP その他

OpenSolaris PHP

はい.ということで続き.

emma sotarok% pfexec pkg search apache | grep php
...
description set       Apache                    pkg:/SUNWapch22m-php52@5.2.9-0.111
emma sotarok% pfexec pkg install SUNWapch22 SUNWapch22m-php52
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    3/3     789/789     5.95/5.95

PHASE                                        ACTIONS
Install Phase                                975/975
PHASE                                          ITEMS
Reading Existing Index                           8/8
Indexing Packages                                3/3

で,

emma sotarok% svcadm enable apache22

したらどうやら起動したようで,Itworks!が出た.faviconがsunだw

emma sotarok% grep DocumentRoot /etc/apache2/2.2/httpd.conf
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/var/apache2/2.2/htdocs"
# This should be changed to whatever you set DocumentRoot to.
    # access content that does not live under the DocumentRoot.

ってことだったので,

emma sotarok% cd /var/apache2/2.2
cgi-bin  error  htdocs  icons  libexec  logs  proxy
emma sotarok% pfexec chown sotarok:staff -R htdocs 

まあ面倒なのでとりあえず俺のものに.

emma sotarok% rm index.html
emma sotarok% echo "<?php phpinfo(); " > index.php     

いつもの紫の画面が出力されたのでOK.

Ethna 動かす

ついでにsymfonyもいれる.

emma sotarok% pfexec pear channel-discover pear.ethna.jp
emma sotarok% pfexec pear channel-discover pear.symfony-project.com
emma sotarok% pfexec pear install -a ethna/ethna symfony/symfony
emma sotarok% ethna
zsh: command not found: ethna

またかw

emma sotarok% ln -s /usr/php/bin/ethna /usr/bin
ln: creating symbolic link `/usr/bin/ethna': Permission denied
emma sotarok% pfexec !!
emma sotarok% pfexec ln -s /usr/php/bin/ethna /usr/bin

pfexec !! 便利
適当に /var/apache2/2.2/lib とかつくって,

emma sotarok% ethna add-project ethnatest
creating directory (/var/apache2/2.2/lib/ethnatest) [y/n]: y
project sub directory created [/var/apache2/2.2/lib/ethnatest/app]
...

project skelton for [ethnatest] is successfully generated at [/var/apache2/2.2/lib]

emma sotarok% ln -s /var/apache2/2.2/lib/ethnatest/www /var/apache2/2.2/htdocs/ethnatest 

http://192.168.135.129/ethnatest/ にアクセスして表示されたーということで設置完了.