引入PHP Symfony!

我要安装Composer。

在Symfony运行的目录中打开终端,并输入以下命令。

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

使用这个命令安装后,brew和composer都会被安装在电脑中,让电脑变得杂乱无章。我不知道解决方法。

安装Symfony

curl -sS https://get.symfony.com/cli/installer | bash

完成以上操作后,下面的消息将显示出来。

Use it as a local file:
  /Users/xxxxxx/.symfony/bin/symfony

Or add the following line to your shell configuration file:
  export PATH="$HOME/.symfony/bin:$PATH"

Or install it globally on your system:
  mv /Users/xxxxxx/.symfony/bin/symfony /usr/local/bin/symfony

Then start a new shell and run 'symfony'

我选择了下面这个选项:在你的系统上全局安装它。

mv /Users/xxxxxx/.symfony/bin/symfony /usr/local/bin/symfony

那么,我们来试试看是否可以动起来啊!

symfony

如果你动了,就移动到你喜欢的目录中。 , jiù nǐ de .)

symfony new project_name

我們假設移動。

cd project_name

开始启动服务器。

symfony server:start

完成了!恭喜你!

赠品

一旦使用ctrl + c命令结束进程,然后通过symfony serve命令启动,即可通过https进行启动。

symfony serve

请参考

安装和设置Symfony框架(Symfony文档)
https://symfony.com/doc/current/setup.html

作曲家
https://getcomposer.org/download/

广告
将在 10 秒后关闭
bannerAds