说明
我现在还没有在Laravel 4环境中工作大约2年。现在,我试图帮助一位朋友,并对网站进行一些修改。在尝试启动和运行网站时,我遇到了一些错误。
步骤
composer update
chmod -R 777 public/vendor/ bootstrap/ app/storage
sudo composer update
php artisan clear-compiled PHP警告:require(/Applications/MAMP/htdocs/code/biossantibodies/bootstrap/environment.php):无法打开流:/Applications/MAMP/htdocs/code/biossantibodies/bootstrap/start.php中没有此类文件或目录在第31行 PHP致命错误:require():无法打开所需的' /Applications/MAMP/htdocs/code/biossantibodies/bootstrap/environment.php' (包含路径=' /应用/ MAMP / htdocs中/代码/ biossantibodies /供应商/ phpseclib / phpseclib / phpseclib:/应用/ MAMP / htdocs中/代码/ biossantibodies /供应商/ PHPUnit的/ PHPUnit的-模拟对象:/应用/ MAMP / htdocs中/代码/ biossantibodies /供应商/ PHPUnit的/ PHP文件迭代器:/应用程序/ MAMP / htdocs中/代码/ biossantibodies /供应商/ PHPUnit的/ PHPUnit的:/应用程序/ MAMP / htdocs中/代码/ biossantibodies /供应商/ symfony中/ yaml:。:/ usr / local / Cellar / php54 / 5.4.41 / lib / php')位于第31行的/Applications/MAMP/htdocs/code/biossantibodies/bootstrap/start.php
为什么我会收到此权限问题? 我认为 chmod -R 777 会照顾这个......
结果
apache_error.log
Wed Oct 26 19:13:33 2016] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zh DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0 configured -- resuming normal operations
[Wed Oct 26 19:18:42 2016] [error] [client ::1] File does not exist: /Applications/MAMP/htdocs/code/biossantibodies/public/docs-assets, referer: http://localhost:8888/MAMP/?language=English
[Thu Oct 27 07:54:53 2016] [notice] caught SIGTERM, shutting down
[Thu Oct 27 07:56:16 2016] [notice] Digest: generating secret for digest authentication ...
[Thu Oct 27 07:56:16 2016] [notice] Digest: done
[Thu Oct 27 07:56:16 2016] [notice] FastCGI: process manager initialized (pid 69323)
[Thu Oct 27 07:56:16 2016] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zh DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0 configured -- resuming normal operations
php_error.log
[27-Oct-2016 14:16:28 Europe/Berlin] PHP Warning: require(/Applications/MAMP/htdocs/code/biossantibodies/bootstrap/environment.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/code/biossantibodies/bootstrap/start.php on line 31
[27-Oct-2016 14:16:28 Europe/Berlin] PHP Fatal error: require(): Failed opening required '/Applications/MAMP/htdocs/code/biossantibodies/bootstrap/environment.php' (include_path='/Applications/MAMP/htdocs/code/biossantibodies/vendor/phpseclib/phpseclib/phpseclib:/Applications/MAMP/htdocs/code/biossantibodies/vendor/phpunit/phpunit-mock-objects:/Applications/MAMP/htdocs/code/biossantibodies/vendor/phpunit/php-file-iterator:/Applications/MAMP/htdocs/code/biossantibodies/vendor/phpunit/phpunit:/Applications/MAMP/htdocs/code/biossantibodies/vendor/symfony/yaml:.:/Applications/MAMP/bin/php/php5.6.10/lib/php') in /Applications/MAMP/htdocs/code/biossantibodies/bootstrap/start.php on line 31
答案 0 :(得分:0)
之所以发生这种情况,是因为您缺少某些供应商文件。添加供应商文件。
试试
composer install
或
composer update
答案 1 :(得分:0)
感谢 @CBroe 评论
“为什么我会收到此权限问题?” - 是什么让您认为“没有此类文件或目录”会成为权限问题?
我意识到我需要创建
<强> /bootstrap/environment.php 强>
<?php
return 'local';
然后,那个白色屏幕不再存在,我终于第一次看到我的网站加载了。