symfony采坑

2018年7月31日21:43:17

安装

首先安装composer 注意

windows下注意

[curl]
 
curl.cainfo =E:phpStudyPHPTutorialphpphp-7.0.12-ntscacert.pem

[openssl]
 
openssl.cafile=E:phpStudyPHPTutorialphpphp-7.0.12-ntscacert.pem
 
cacert.pem https://curl.haxx.se/docs/caextract.html
不会composer 请看 https://www.cnblogs.com/zx-admin/p/9212286.html
 
注意目前常用的3.4和4.1区别比较大
4.1需要php7.1以上,而且翻译的文档目前没有中文的
3.4 最好php5.4以上
测试的是php-7.0.12,如果是新项目建议 4.1 http://www.phpbenchmarks.com/en/comparator/frameworks.html 性能不错
3.4安装
php -r "readfile('http://symfony.com/installer');" > symfony

php symfony new E:phpStudyPHPTutorialWWWmy_project 3.4 可以指定版本也可以不执行

4.1安装

composer create-project symfony/skeleton E:phpStudyPHPTutorialWWWproject

需要php7.1以上不然报错

首先谈下demo代码初始感觉,很简单,但是目录名称都不算特别准确,不像tp laravel

但是感觉起来还不错

直接基于php运行

php bin/console server:run
http://localhost:8000

注意在项目根目录

原文地址:https://www.cnblogs.com/zx-admin/p/9398187.html