Php Codeception不接受本地主机url
我正在运行Codeception来对付一个Laravel Homestead流浪汉实例。PHP版本5.5.12,Laravel 4.*。Codeception版本2.0.0 我可以使用localhost:8000、127.0.0.1:8000或mysite.app:8000通过Chrome访问该网站。该网站还远程部署在一台AWS服务器上,该服务器没有域名,但有一个公共IP地址,通过Chrome查看时可以正常工作 我还可以将所有这些URL在本地进行卷曲 我已按照此处指示的设置过程进行了操作: 除了最后一步外,每一步都很好 我的测试,WelcomeCert.php:Php Codeception不接受本地主机url,php,laravel,codeception,Php,Laravel,Codeception,我正在运行Codeception来对付一个Laravel Homestead流浪汉实例。PHP版本5.5.12,Laravel 4.*。Codeception版本2.0.0 我可以使用localhost:8000、127.0.0.1:8000或mysite.app:8000通过Chrome访问该网站。该网站还远程部署在一台AWS服务器上,该服务器没有域名,但有一个公共IP地址,通过Chrome查看时可以正常工作 我还可以将所有这些URL在本地进行卷曲 我已按照此处指示的设置过程进行了操作: 除了
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('see the landing page');
$I->amOnPage('/');
$I->see('Welcome');
class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- AcceptanceHelper
config:
PhpBrowser:
url: 'http://127.0.0.1:8000'
1) Failed to see the landing page in WelcomeCept.php (/Users/andrew/code/site/tests/acceptance/WelcomeCept.php)
Sorry, I couldn't am on page "/":
GuzzleHttp\Exception\RequestException: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Scenario Steps:
1. I am on page "/"
#1 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:250
#2 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:84
#3 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:70
#4 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:200
#5 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php:57
#6 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/Emitter.php:105
#7 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php:75
#8 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/Curl/CurlAdapter.php:94
#9 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#10 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Client.php:186
#1 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:250
#2 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:84
#3 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:70
#4 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:200
#5 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php:57
#6 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/Emitter.php:105
#7 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php:75
#8 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/Curl/CurlAdapter.php:94
#9 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#10 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Client.php:186
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
执行codeept run时的控制台输出:
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('see the landing page');
$I->amOnPage('/');
$I->see('Welcome');
class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- AcceptanceHelper
config:
PhpBrowser:
url: 'http://127.0.0.1:8000'
1) Failed to see the landing page in WelcomeCept.php (/Users/andrew/code/site/tests/acceptance/WelcomeCept.php)
Sorry, I couldn't am on page "/":
GuzzleHttp\Exception\RequestException: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Scenario Steps:
1. I am on page "/"
#1 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:250
#2 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:84
#3 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:70
#4 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:200
#5 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php:57
#6 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/Emitter.php:105
#7 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php:75
#8 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/Curl/CurlAdapter.php:94
#9 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#10 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Client.php:186
#1 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:250
#2 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:84
#3 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:70
#4 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:200
#5 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php:57
#6 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/Emitter.php:105
#7 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php:75
#8 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/Curl/CurlAdapter.php:94
#9 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#10 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Client.php:186
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
当我尝试访问或访问时,会出现相同的错误 只需我的评论作为回答
看起来您没有在本地计算机上的php.ini中设置时区设置。请参见php.net/manual/en/datetime.configuration.php GUZLEHTTP\Exception\RequestException:strotime():依赖系统的时区设置是不安全的。您需要使用date.timezone设置或date\u default\u timezone\u set()函数。如果您使用了这些方法中的任何一种,但仍然收到此警告,则很可能是您拼错了时区标识符。我们暂时选择了时区“UTC”,但请设置date.timezone以选择您的时区
看起来您没有在本地计算机上的php.ini中设置时区设置。看,是的,这就成功了!谢谢