ZendFramework2系をインストールしてみた。
ZendFramework2系をインストールしてみた。
Git clone
インストール自体はGitからcloneするだけだったから簡単。
しかし、下記のようなエラーが出てしまった。
Warning: Unexpected character in input: '\' (ASCII=92) state=1
Parse error: syntax error, unexpected T_STRING in
調べてみると、以下の記事を発見。
Apparently, the server was running PHP 5.3 in the SSH console, however the Apache server was still using PHP 5.2, therefor unable to use namespaces.So, even though the account was setup for "PHP 5.3", the .htaccess needs to be changed in order to support that.
In order to fix the problem, add the following line to the .htaccess file in the /public/: AddHandler x-httpd-php5-3 .php
php - Setting up Zend Framework 2 on GoDaddy - Stack Overflow
どうやらPHPのバージョンを.htaccessで指定する必要があるみたい。
= /public/.htaccessへ使用するphpのバージョンをAddHandlerで指定すればOK。
当方、php5.5を入れたばかりだったので、
AddHandler x-httpd-php5-5 .php
を追記。
どうやら無事に表示されたみたいだ。
これから細かい設定を見ていこう。
参考:Simpla Note: Zend Framework 2 : Instalation and Make a Module