dqxafj6830 2016-09-10 19:08
浏览 44
已采纳

无法在localhost上启动Symfony 2.7

I have a symfony frame work(v 2.7) on my Ubuntu 16.04, that i want to start on the XAMP local server by running this command in the framework's directory :

php app/console server:run

But when i run this in terminal, i get the following errors:

Warning: require_once(/opt/lampp/htdocs/WorkSpace/my-project/frameWork/app/bootstrap.php.cache): failed to open stream: No such file or directory in /opt/lampp/htdocs/WorkSpace/my-project/frameWork/app/console on line 10
PHP Fatal error:  require_once(): Failed opening required '/opt/lampp/htdocs/WorkSpace/my-project/frameWork/app/bootstrap.php.cache' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/WorkSpace/my-project/frameWork/app/console on line 10

Fatal error: require_once(): Failed opening required '/opt/lampp/htdocs/WorkSpace/my-project/frameWork/app/bootstrap.php.cache' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/WorkSpace/my-project/frameWork/app/console on line 10

After some research i thought that i should run composer update or/and composer install commands to generate the bootstrap cache file and fix the issues.

But once i installed composer globally and ran composer update in framework's directory, it seems that composer is using a php that is not in XAMP's folder(Although I have set my $PATH to /opt/lampp/bin).

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/curl.so' - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mcrypt.so' - /usr/lib/php/20151012/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for ahmedsamy/hype-mailchimp-bundle dev-master -> satisfiable by ahmedsamy/hype-mailchimp-bundle[dev-master].
    - ahmedsamy/hype-mailchimp-bundle dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.
  Problem 2
    - aws/aws-sdk-php 2.5.0 requires guzzle/guzzle >=3.7.0,<3.9.0 -> satisfiable by guzzle/guzzle[v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4, v3.8.0, v3.8.1].
    - aws/aws-sdk-php 2.5.1 requires guzzle/guzzle >=3.7.0,<....

It says Unable to load dynamic library '/usr/lib/php ,whereas the php i want it to use is in lamps folder /opt/lampp/bin .

When i run which php it shows the correct php which XAMP is using.

So now i dont know how to tell composer to use the php in the lamp's folder and is the composer update is the fix for this issue in the first place.

  • 写回答

1条回答 默认 最新

  • dongshi4773 2016-09-12 12:48
    关注

    Have you tried adding the XAMP PHP version to your path (i.e. in your .bash_profile or equivalent)?

    export PATH=/opt/lampp/bin:$PATH
    

    PS : don't forget to reload your shell afterwards

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程