Symfony(3)Environment Update and Configure
1. PHP Enhancement
When I try to run the Command
>composer install
Loading composer repositories with package information
I get this Error Message
guzzle/guzzle v3.8.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Solution:
Check the curl on my machine
>curl -V
curl 7.28.1 (x86_64-apple-darwin12.2.0) libcurl/7.28.1 OpenSSL/1.0.1g zlib/1.2.8 libidn/1.25Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
>which curl
/opt/local/bin/curl
Header files are here:
/opt/local/include/curl
Then rebuild the PHP with the parameter —with-curl
>./configure --prefix=/Users/carl/tool/php-5.5.13 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl
Check if the environment is Good now.
>php -m
[PHP Modules] Core ctype datecurl
dom
Good, I have curl there now.
Rebuild the PHP with this command
>./configure --prefix=/Users/carl/tool/php-5.5.13 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl --with-apxs2=/opt/httpd/bin/apxs --with-mysql
2. Apache HTTP Server Configuration
>apachectl -version
Server version: Apache/2.2.26 (Unix) Server built: Dec 10 2013 22:09:38
But I prefer to compile and install the apache manually.
>wget http://mirror.reverse.net/pub/apache//httpd/httpd-2.4.9.tar.gz
Unzip the file and enter that directory
>cd /Users/carl/data/installation/httpd-2.4.9
>./configure --prefix=/Users/carl/tool/httpd-2.4.9 --enable-so --enable-proxy --enable-proxy-ajp --enable-proxy-http --enable-proxy-ftp --enable-proxy-connect --enable-proxy-balancer
or
>./configure —prefix=/Users/carl/tool/httpd-2.4.9 --enable-modules=all --enable-so
>make
Error Message:
libtool: link: cannot find the library `/opt/local/lib/libexpat.la' or unhandled argument `/opt/local/lib/libexpat.la' make[2]: *** [htpasswd] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all-recursive] Error 1
Solution:
Install APR
>wget http://www.poolsaboveground.com/apache//apr/apr-1.5.1.tar.gz
>./configure --prefix=/Users/carl/tool/apr-1.5.1
make and make install after that
>sudo ln -s /opt/apr-.1.5.1 /opt/apr
Add to the PATH
Install apr-util
>wget http://www.poolsaboveground.com/apache//apr/apr-util-1.5.3.tar.gz
>./configure --prefix=/Users/carl/tool/apr-util-1.5.3 --with-apr=/opt/apr
make and make install after that.
Install PCRE
>wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
>./configure --prefix=/Users/carl/tool/pcre-8.35
make and make install
Let Install HTTPD again
>./configure --prefix=/Users/carl/tool/httpd-2.4.9 --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-pcre=/opt/pcre
make and make install.
>apachectl -version
Server version: Apache/2.4.9 (Unix) Server built: Jun 5 2014 13:47:11
Then I go on to configure the HTTPD, we face a lot of Error Messages as follow when I configure HTTPD
Error Message
web/.htaccess: <IfModule not allowed here
Error Message
Directory index forbidden by Options directive
Error Message
PHP Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'
PHP Fatal error: Call to undefined function \\SDK\\mcrypt_get_iv_size()
Error Message
configure: error: *** libmcrypt was not found
Error Message
rfc2440.c:26:10: fatal error: 'malloc.h' file not found
Error Message
-bash: aclocal: command not found
Solution:
>sudo chmod -R 777 /Users/carl/work/symfony/myfirstproject/app/cache/
Install libmcrypt
>wget http://iweb.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
configure, make, sudo make install
Install libmhash
>wget http://tcpdiag.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
configure, make, sudo make install
/usr/include/sys/malloc.h
/usr/include/malloc/malloc.h
>sudo ln -s /usr/include/malloc/malloc.h /usr/include/malloc.h
Install mcrypt http://us2.php.net/mcrypt
>wget http://hivelocity.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
configure, make, sudo make install
Install automake
>wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
configure, make, sudo make install
Install the PHP extension
>cd php-5.5.13/ext/mcrypt/
>phpize
>aclocal
configure, make, sudo make install
Installing shared extensions: /Users/carl/tool/php-5.5.13/lib/php/extensions/no-debug-zts-20121212/
Find php.ini and add this line
extension=mcrypt.so
3. How to configure Web Server
Some Important Configuration in httpd.conf
LoadModule php5_module modules/libphp5.so
ServerName 127.0.0.1:80
# Virtual hosts Include conf/extra/httpd-vhosts.conf
<FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>
Here is the configuration on httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin luohuazju@gmail.com
DocumentRoot "/Users/carl/work/winner/winner-seller-console/mytodo/dist" ServerName uiseed.sillycat.com
<Directory "/Users/carl/work/winner/winner-seller-console/mytodo/dist">
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/uiseed_err.log
CustomLog /var/log/apache2/uiseed.log combined
</VirtualHost>
Haha, the first part is a configuration to load the angular projects. Not the symfony.
Here is the part to load symfony project.
<VirtualHost *:80>
ServerName sdk-consumer.local.sillycat.com
DocumentRoot /Users/carl/work/symfony/myfirstproject/web
<Directory "/Users/carl/work/symfony/myfirstproject/web"> AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/sdk-consumer_err.log
CustomLog /var/log/apache2/sdk-consumer.log combined
SetEnv SYMFONY_ENV local
SetEnv SYMFONY_DEBUG 1
</VirtualHost>
Start to work on further.
References:
http://www.php.net/manual/en/curl.installation.php
http://stackoverflow.com/questions/4976971/compiling-php-with-curl-where-is-curl-installed
Apache HTTP Installation
http://httpd.apache.org/docs/trunk/install.html
http://httpd.apache.org/download.cgi#apache24
http://sillycat.iteye.com/blog/795517
http://sillycat.iteye.com/blog/562651
http://ajiewps.sinaapp.com/?p=226
http://sillycat.iteye.com/blog/563656
http://sillycat.iteye.com/blog/563657
PHP from Apache2
http://sillycat.iteye.com/blog/2066063
http://sillycat.iteye.com/blog/1638638
http://www.php.net/manual/en/install.unix.apache2.php
http://www.madcapsule.com/blog/php-mcrypt-magento-error
http://coolestguidesontheplanet.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/
http://www.glenscott.co.uk/blog/install-mcrypt-php-extension-on-mac-os-x-lion/
configure web server
http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
http://bordenia.wordpress.com/2012/04/14/deploying-your-symfony-2-0-web-app-to-the-production-server/
相关推荐
解压密码在:http://www.pin5i.com/showtopic-building-php-applications-with-symfony-cakephp-zend-framework.html
### Symfony 3.x.x通过命令行操作数据库 #### 概述 Symfony 是一款基于 PHP 的高性能 Web 开发框架,它采用 MVC 架构模式,并且提供了丰富的组件来帮助开发者更高效地开发应用。Symfony 3.x.x 版本是该框架的一个...
symfony-jsonapi, 用于 Symfony 2和 Symfony 3的JSON API变压器包 Symfony json对于 Symfony 2和 Symfony 3 安装工具使用情况创建映射输出API响应JSON API请求JSON API响应与NelmioApiDocBund
**Symfony** Symfony是一款开源的PHP框架,用于构建高质量的、可维护的Web应用程序。它遵循MVC(模型-视图-控制器)架构模式,提供了一套强大的工具来简化Web开发过程,包括路由、依赖注入、事件系统、表单处理、...
php symfony api 手册chm
### 3. 设计数据模型 在 Symfony2 中,我们通常使用 Doctrine ORM 来处理数据库。为博客创建两个实体:`Post`(代表博客文章)和`Comment`(代表评论)。定义每个实体的属性,如标题、内容、作者、发布时间等,并...
Symfony_metabook_2.0是一份针对Symfony 2.0版本的使用文档,涵盖了从安装配置到项目管理、数据库交互、性能优化等多个方面,为开发者提供了全面的指南。Symfony 2.0相较于早期版本有许多改进,例如支持PHP5.3以上...
**Symfony API CHM手册**是针对Symfony框架的重要参考资料,它以离线帮助文档(CHM:Compiled Help Manual)的形式提供,方便开发者在无网络的情况下查阅Symfony框架的各种API和功能。Symfony是一个广泛使用的PHP...
在本书里,你将了解如何使用symfony建立Web应用程序。本书分成五篇:“基础知识”篇,包含所有的基本概念和开始symfony的基本知识;“核心架构”篇,讲述模型视图控制器(MVC)在symfony中的实现,以及如何用这样的...
Symfony框架的显著特点是它完整实现了模型-视图-控制器(MVC)三层架构,这意味着开发人员可以将应用逻辑、数据处理和用户界面分离,以实现更高的代码维护性和可扩展性。Symfony的MVC架构包含以下几个核心部分: - ...
3. **表单相关**:Symfony2提供了一套强大的表单处理系统,可以轻松创建和处理HTML表单。`表单相关.txt`可能讲解了如何定义表单类型、创建表单实例、绑定数据、验证及渲染表单等步骤。 4. **事件监听**:Symfony2的...
Symfony2.3.1是在2.3系列中的一个稳定版本,发布于2014年,旨在提供可靠的服务和组件,帮助开发者快速构建复杂的Web应用。 首先,Symfony框架遵循MVC(Model-View-Controller)设计模式,它将业务逻辑、数据处理和...
3. **模板引擎**:Twig是Symfony推荐的模板引擎,它提供了一种简洁、安全的方式来编写视图层代码,同时支持继承、过滤器和函数等高级功能。 4. **数据库抽象层**:Symfony与Doctrine ORM紧密集成,提供了对多种...