詳しいことは後で
(1)gitのインストール
wget ftp://fr2.rpmfind.net/linux/dag/redhat/el6/en/x86_64/extras/RPMS/perl-Error-0.17016-1.el6.rfx.noarch.rpm
sudo rpm -ivh perl-Error-0.17016-1.el6.rfx.noarch.rpm
cd /etc/yum.repos.d/
sudo wget http://wing-repo.net/wing/6/EL6.wing.repo
sudo vi EL6.wing.repo
ここで、以下のようにファイル編集
[wing]
name=EL $releasever - $basearch - wing Repository
baseurl=http://wing-repo.net/wing/6/$basearch/
enabled=1
gpgcheck=0
(以下省略)
[wing]のenabledを1にする
そうしたら
sudo yum install git
(2)composerを入れる
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
(3)Zend Framework 2のインストール
cd /var/www
sudo git clone git://github.com/zendframework/ZendSkeletonApplication.git
cd ZendSkeletonApplication
sudo composer install
(4)httpd.confの修正
sudo vi /etc/httpd/conf/httpd.conf
最後に以下の内容を追加
<VirtualHost *:80>
DocumentRoot /var/www/ZendSkeletonApplication/public
<Directory /var/www/ZendSkeletonApplication/public>
AllowOverride All
# Require all granted # For Apache version >=2.4
Order allow,deny # For Apache version < 2.4
Allow from all # For Apache version < 2.4
</Directory>
</VirtualHost>
(5)リスタート
sudo service httpd start
(6)Smarty
git clone https://github.com/smarty-php/smarty.git
sudo mv smarty/ /usr/local/lib/Smarty-3.1.32
sudo vi /etc/php.ini
include_path = ".:/php/includes;/usr/local/lib/Smarty-3.1.32/libs"
sudo service httpd restart
(7)ZendSmarty
・使いたいなら・・・
git clone https://github.com/ryanknu/ZendSmarty.git
【おまけ:postgreSQLの設定】
sudo yum -y localinstall https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
sudo yum -y install postgresql96-server
sudo service postgresql-9.6 initdb
sudo service postgresql-9.6 start
ここで、
psql -U postgres -d postgres
とやると、失敗するかも。。。パスワードを振ってから
※postgresにパスワードをふる
・パスワード設定
sudo passwd postgres
postgresのパスワードにする
・Postgreにも設定(そのとき、su postgresで、postgres担ってから設定)
su postgres
postgresのパスワードにする
psql -c "alter role postgres with password 'postgresのパスワードにする'";
・pg_hbaの修正&再起動
sudo vi /var/lib/pgsql/9.6/data/pg_hba.conf
# "local" is for Unix domain socket connections only
local all all md5 # <- 変更
sudo service postgresql-9.6 restart
・確認
psql -U postgres
でパスワードを聞かれる。パスワードを入れると入れる
・PDOを入れておく
プログラムを動かすときに必要
sudo yum install -y php-pdo
sudo yum install php-pdo_pgsql
【参考】
http://blog.goo.ne.jp/xmldtp/e/e0f3bfae6d51a5696419068949b0748d
https://tecadmin.net/how-to-install-php-zend-framework-on-linux-server/
↧
Red Hat Enterprise Linux 6 にZendを入れる
↧