I am attempting to run a build on Jenkins running Ubuntu 14.04. My PHPUnit is crashing with the below error message, but there doesn't seem to much out there regarding this error. My xdebug appears to be loading correctly. I am running PHPUnit v4.8.10.
When I try to run phpunit via the command line directly, it just hangs and doesn't return. What am I missing?
phpunit:
[phpunit] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(//proc/tty/driver): failed to open dir: Permission denied' in /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Factory.php:66
[phpunit] Stack trace:
[phpunit] #0 [internal function]: RecursiveDirectoryIterator->__construct('//proc/tty/driv...', 512)
[phpunit] #1 [internal function]: RecursiveDirectoryIterator->getChildren()
[phpunit] #2 [internal function]: FilterIterator->rewind()
[phpunit] #3 /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Factory.php(66): AppendIterator->append(Object(File_Iterator))
[phpunit] #4 /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Facade.php(38): File_Iterator_Factory->getFileIterator(Array, '.php', '', Array)
[phpunit] #5 /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php(112): File_Iterator_Facade->getFilesAsArray('/', '.php', '')
[phpunit] #6 /var/lib/jenkins/jobs/Some other job/workspace/vend in /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Factory.php on line 66
BUILD FAILED
/var/lib/jenkins/jobs/Some other job/workspace/build.xml:169: exec returned: 255
PHP Info:
PHP 5.5.9-1ubuntu4.13 (cli) (built: Sep 29 2015 15:24:49)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
The problem was with my whitelisting inside my phpunit.xml. As you can see in the <directory> tag, I was telling my code coverage to start at the root of the server! Which is how it ended up looking through my sockets and getting caught somewhere it shouldn't have been.
To resolve this, change the <directory suffix=".php">/</directory> below to <directory suffix=".php">./</directory> so the code coverage only looks through your project directory.
The old filter:
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">/</directory>
<exclude>
<file>bootstrap/autoload.php</file>
</exclude>
</whitelist>
</filter>
Related
When I run codesniffer for magento2 extension by following the doc - https://developer.adobe.com/commerce/php/coding-standards/
From magento root directory I run
vendor/bin/phpcbf --standard=Magento2 ./app/code/Test/Module
I get the following error
PHP Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: The $start position for getTokensAsString() must exist in the token stack in /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/File.php:2112
Stack trace:
#0 /home/cloudpanel/htdocs/magento2.mgt/vendor/magento/magento-coding-standard/Magento2/Sniffs/Functions/FunctionsDeprecatedWithoutArgumentSniff.php(66): PHP_CodeSniffer\Files\File->getTokensAsString()
#1 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/File.php(498): Magento2\Sniffs\Functions\FunctionsDeprecatedWithoutArgumentSniff->process()
#2 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php(92): PHP_CodeSniffer\Files\File->process()
#3 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Fixer.php(174): PHP_CodeSniffer\Files\LocalFile->process()
#4 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php(52): PHP_CodeSniffer\Fixer->fixFile()
#5 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Reporter.php(285): PHP_CodeSniffer\Reports\Cbf->generateFileReport()
#6 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Runner.php(657): PHP_CodeSniffer\Reporter->cacheFileReport()
#7 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Runner.php(434): PHP_CodeSniffer\Runner->processFile()
#8 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Runner.php(200): PHP_CodeSniffer\Runner->run()
#9 /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/bin/phpcbf(18): PHP_CodeSniffer\Runner->runPHPCBF()
#10 /home/cloudpanel/htdocs/magento2.mgt/vendor/bin/phpcbf(120): include('...')
#11 {main}
thrown in /home/cloudpanel/htdocs/magento2.mgt/vendor/squizlabs/php_codesniffer/src/Files/File.php on line 2112
my php version is
PHP 8.1.8 (cli) (built: Jul 8 2022 07:08:08) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies
with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies
I am using Magento 2.4.4
What is the issue here?
OS: Ubuntu 20.04 LTS
PHP Version: 7.4.22
I am trying to install a package with composer. But it caused a Segmentation Fault:
root#micro7:/www/wwwroot/micro7.ml# composer require laravel/breeze
Segmentation fault (core dumped)
The problem also appeared when creating project with composer:
root#micro7:~# composer create-project laravel/laravel micro7.ml
Creating a "laravel/laravel" project at "./micro7.ml"
Segmentation fault (core dumped)
I used gdb to get the stack trace of the dumped core, it looked like this:
root#micro7:~# gdb php core
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from php...
[New LWP 583799]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php /usr/bin/composer create-project laravel/laravel micro7.ml'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fec2b356e00 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
(gdb) bt
#0 0x00007fec2b356e00 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#1 0x00007fec2c1ecf6c in SSL_CTX_new () from /usr/local/openssl/lib/libssl.so.1.0.0
#2 0x00007fec2bf0ab3c in ossl_connect_step1 () from /usr/local/lib/libcurl.so.4
#3 0x00007fec2bf0c4ff in ossl_connect_common () from /usr/local/lib/libcurl.so.4
#4 0x00007fec2bf0d47c in Curl_ssl_connect_nonblocking () from /usr/local/lib/libcurl.so.4
#5 0x00007fec2bed2996 in https_connecting () from /usr/local/lib/libcurl.so.4
#6 0x00007fec2bed4383 in Curl_http_connect () from /usr/local/lib/libcurl.so.4
#7 0x00007fec2bee734d in multi_runsingle () from /usr/local/lib/libcurl.so.4
#8 0x00007fec2bee84b1 in curl_multi_perform () from /usr/local/lib/libcurl.so.4
#9 0x000055bdd4a2c339 in zif_curl_multi_exec ()
#10 0x000055bdd5166c3d in execute_ex ()
#11 0x000055bdd517e815 in zend_execute ()
#12 0x000055bdd4fce45b in zend_execute_scripts ()
#13 0x000055bdd4f05a84 in php_execute_script ()
#14 0x000055bdd51815df in do_cli ()
#15 0x000055bdd5182a24 in main ()
If you look at the first line of the output of the bt, you'll find that the Segmentation Fault maybe caused when establishing a SSL connection to the server of packagist.
I tried to reinstall composer, switch to the super user, reboot the server, even reinstalling the OS, but the problem still persist!
Im starting a project with autodesk forge in PHP, but I got an arror that I cant solve. I did everything in this site https://learnforge.autodesk.io/#/environment/setup/2legged to create a server in PHP and Node.js. In node I got success but my friends want to make it in php.
Got 2 errors and I solve one:
The first one was:
HP Fatal error: Uncaught TypeError: Argument 1 passed to Dotenv\Dotenv::create() must be an instance of Dotenv\Repository\RepositoryInterface, string given, called in /Users/.../forgeExample/server/config.php on line 14 and defined in /Users/.../forgeExample/vendor/vlucas/phpdotenv/src/Dotenv.php:83
Stack trace:
#0 /Users/.../forgeExample/server/config.php(14): Dotenv\Dotenv::create('/Users/mackleym...')
#1 /Users/.../forgeExample/server/oauth.php(14): Autodesk\ForgeServices\ForgeConfig::getForgeID()
#2 /Users/.../forgeExample/server/oauth.php(49): Autodesk\ForgeServices\AuthClientTwoLegged->__construct()
#3 /Users/.../forgeExample/index.php(8): include_once('/Users/mackleym...')
#4 {main}
thrown in /Users/.../forgeExample/vendor/vlucas/phpdotenv/src/Dotenv.php on line 83
I solve this with the help in vlucas/phpdotenv by changing the line 14 in server/config.php from:
$dotenv = Dotenv::create(__DIR);
to $dotenv = Dotenv::createImmutable(__DIR__);
The server runs and stops loading the exemple with this second error:
PHP Fatal error:
Uncaught Autodesk\Core\Exception\RuntimeException: The client_id specified does not have access to the api product in /Users/mackleymagalhaes/development/.../forgeExample/vendor/autodesk/core/lib/Auth/TokenFetcher.php:108
Stack trace:
#0 /Users/mackleymagalhaes/development/.../forgeExample/vendor/autodesk/core/lib/Auth/TokenFetcher.php(87): Autodesk\Auth\TokenFetcher->makeRequest('https://develop...', Array)
#1 /Users/mackleymagalhaes/development/.../forgeExample/vendor/autodesk/core/lib/Auth/OAuth2/AbstractOAuth2.php(143): Autodesk\Auth\TokenFetcher->fetch('https://develop...', 'client_credenti...', Array, Array)
#2 /Users/mackleymagalhaes/development/.../forgeExample/vendor/autodesk/core/lib/Auth/OAuth2/TwoLeggedAuth.php(15): Autodesk\Auth\OAuth2\AbstractOAuth2->fetchAccessToken('authentication/...', 'client_credenti...')
#3 /Users/mackleymagalhaes/development/.../forgeExample/server/oauth.php(38): Autodesk\Auth\OAuth2\TwoLeggedAuth->fetchToken()
#4 /Users/mackleymagalhaes/developme in /Users/mackleymagalhaes/development/.../forgeExample/vendor/klein/klein/src/Klein/Klein.php on line 954
[Thu Sep 3 16:59:07 2020] [::1]:58380 [200]: GET /api/forge/oss/buckets?id=%23 - Uncaught Autodesk\Core\Exception\RuntimeException: The client_id specified does not have access to the api product in /Users/mackleymagalhaes/development/.../forgeExample/vendor/autodesk/core/lib/Auth/TokenFetcher.php:108
Stack trace:
#0 /Users/mackleymagalhaes/development/.../forgeExample/vendor/autodesk/core/lib/Auth/TokenFetcher.php(87): Autodesk\Auth\TokenFetcher->makeRequest('https://develop...', Array)
#1 /Users/.../forgeExample/vendor/autodesk/core/lib/Auth/OAuth2/AbstractOAuth2.php(143): Autodesk\Auth\TokenFetcher->fetch('https://develop...', 'client_credenti...', Array, Array)
#2 /Users/.../forgeExample/vendor/autodesk/core/lib/Auth/OAuth2/TwoLeggedAuth.php(15): Autodesk\Auth\OAuth2\AbstractOAuth2->fetchAccessToken('authentication/...', 'client_credenti...')
#3 /Users/.../forgeExample/server/oauth.php(38): Autodesk\Auth\OAuth2\TwoLeggedAuth->fetchToken()
#4 /Users/mackleymagalhaes/developme in /Users/mackleymagalhaes/development/.../forgeExample/vendor/klein/klein/src/Klein/Klein.php on line 954
anyone know what is this?
after downgrade my version of vlucas/phpdoenv to ^3.0.0 I`ve got this errors on console:
[Tue Sep 8 12:12:13 2020] [404] /api/forge/oss/buckets - No such file
or directory [Tue Sep 8 09:12:14 2020] PHP Fat al error: Uncaught
Autodesk\Forge\Client\ApiException: [403] Error connecting to the API
(https://developer.api.autodesk.com/oss/v2/buckets) in
..\forge-example2\vendor\autodesk\forge-client\lib\ApiClient.php:261 S
tack trace:
#0 ..\forge-example2\vendor\autodes k\forge-client\lib\Api\AbstractApi.php(89):
Autodesk\Forge\Client\ApiClient->callApi('/oss/v2/buckets', 'GET',
Array, '', Array, '\Autodesk\Forge...', '/oss/v 2/buckets')
#1 ..\forge-example2\vendor\autodesk\forge-cl ient\lib\Api\BucketsApi.php(390):
Autodesk\Forge\Client\Api\AbstractApi->callApi('/oss/v2/ buckets',
'GET', Array, '', Array, '\Autode sk\Forge...', '/oss/v2/buckets')
#2 ..\forge-example2\vendor\autodesk\forge-client\lib\Api \BucketsApi.php(330):
Autodesk\Forge\Client\Api\BucketsApi->getBucketsWithH ttpInfo(NULL,
NULL, NULL)
#3 ..\forge- example2\server\oss.php(47): Autodesk\Forge\Client\Api\BucketsApi->getBuckets()
#4 D:\UFU\for ge-example2\index.php(26): Autodesk\ForgeS ervices\DataManagement->getBucketsAndObjects()
#5 [internal fun in ..\forge-example2\vendor\klein\klein\src\Klein\Klein.php on line 954
[Tue Sep 8 09:12:14 2020] [::1]:54087 [200]: GET
/api/forge/oss/buckets?id=%23 - Uncaught
Autodesk\Forge\Client\ApiException: [403 ] Error connecting to the API
(https://developer.api.autodesk.com/oss/v2/buckets) in D:\UFU\forge-
example2\vendor\autodesk\forge-client\lib\Ap iClient.php:261 Stack
trace:
#0 ..\forge-example2\vendor\autodesk\forge-client\lib\Api \AbstractApi.php(89): Autodesk\Forge\C
lient\ApiClient->callApi('/oss/v2/buckets', 'GET', Array, '', Array,
'\Autodesk\Forge...', '/oss/v2/buckets')
#1 ..\forge-exam ple2\vendor\autodesk\forge-client\lib\Api\BucketsApi.php(390):
Autodesk\Forge\Client\Api\Abst ractApi->callApi('/oss/v2/buckets',
'GET', Array, '', Array, '\Autodesk\Forge...', '/oss/v2/b uckets')
#2 ..\forge-example2\vendor\auto desk\forge-client\lib\Api\BucketsApi.php(330):
Autodesk\Forge\Client\Api\BucketsApi->getBuc ketsWithHttpInfo(NULL,
NULL, NULL)
#3 ..\forge-example2\server\oss.php(47): Autodesk\Forge\Client\Api\BucketsApi->getBuckets()
#4 ..\forge-example2\index.php(26): Aut odesk\ForgeServices\DataManagement->getBucketsAndObjects()
#5 [internal fun in D:\UFU\forge-ex ample2\vendor\klein\klein\src\Klein\Klein.php on line 954
[Tue Sep 8 09:12:14 2020] [::1]:54087 Closing
I ran into the same issue, and in my case it ended up being some version mismatch of the vlucas/phpdotenv dependency. Here's what I did to get the PHP sample working (in the project's root folder, using bash):
# confirm you have a good version of PHP (in my case it's 7.3.11)
php -v
# remove composer dependencies
rm -rf vendor
rm composer.lock
# setup composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar install
# create the .env file
cp server/.env.example server/.env
vim server/.env # add your client ID and client secret
# start the app
php -S localhost:3000 -t .
# now, open your browser and go to http://localhost:3000/www/index.html
I'm working on a PHP extension that I'm trying to test on travis. Unit tests reveal a segfault that only occur on travis and I can't reproduce it locally no matter what I try.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff1ccc0000
Core was generated by `/home/travis/.phpenv/versions/5.6/bin/php -d output_handler= -d open_basedir= -'.
Program terminated with signal 11, Segmentation fault.
#0 0x000000000095c6b8 in gc_zval_check_possible_root (tsrm_ls=<optimized out>, z=<optimized out>) at /tmp/php-build/source/5.6.3/Zend/zend_gc.h:183
183 /tmp/php-build/source/5.6.3/Zend/zend_gc.h: No such file or directory.
Thread 1 (Thread 0x7f759eae4740 (LWP 12532)):
#0 0x000000000095c6b8 in gc_zval_check_possible_root (tsrm_ls=<optimized out>, z=<optimized out>) at /tmp/php-build/source/5.6.3/Zend/zend_gc.h:183
#1 i_zval_ptr_dtor (tsrm_ls=<optimized out>, zval_ptr=<optimized out>) at /tmp/php-build/source/5.6.3/Zend/zend_execute.h:86
#2 zend_do_fcall_common_helper_SPEC (execute_data=<optimized out>, tsrm_ls=0x32fee10) at /tmp/php-build/source/5.6.3/Zend/zend_vm_execute.h:564
#3 0x000000000092194b in execute_ex (execute_data=0x7f759eaa5100, tsrm_ls=0x32fee10) at /tmp/php-build/source/5.6.3/Zend/zend_vm_execute.h:363
#4 0x00000000008b1098 in zend_execute_scripts (type=8, tsrm_ls=0x32fee10, retval=0x0, file_count=3) at /tmp/php-build/source/5.6.3/Zend/zend.c:1344
#5 0x000000000083e404 in php_execute_script (primary_file=0x7fff1cc7ff70, tsrm_ls=0x32fee10) at /tmp/php-build/source/5.6.3/main/main.c:2584
#6 0x0000000000960467 in do_cli (argc=63, argv=0x32fe2f0, tsrm_ls=0x32fee10) at /tmp/php-build/source/5.6.3/sapi/cli/php_cli.c:994
#7 0x000000000044a960 in main (argc=63, argv=0x32fe2f0) at /tmp/php-build/source/5.6.3/sapi/cli/php_cli.c:1378
I really don't know what can cause it, since I can't reproduce.
I receive that error when try send e-mail with CakePHP 2.3.0.
My Cloud configuration is:
PHP 5.4
Apache 2.2
MySQL 5.5
CakePHP 2.3.0
Sorry about my english.
2013-03-06 09:15:05 Error: [SocketException] Permission denied
Request URL: /notifications/sendContact
Stack Trace:
#0 /var/www/html/site/lib/Cake/Network/Email/SmtpTransport.php(96): CakeSocket->connect()
#1 /var/www/html/site/lib/Cake/Network/Email/SmtpTransport.php(60): SmtpTransport->_connect()
#2 /var/www/html/site/lib/Cake/Network/Email/CakeEmail.php(1065): SmtpTransport->send(Object(CakeEmail))
#3 /var/www/html/site/app/Controller/NotificationsController.php(41): CakeEmail->send()
#4 [internal function]: NotificationsController->sendContact()
#5 /var/www/html/site/lib/Cake/Controller/Controller.php(485): ReflectionMethod->invokeArgs(Object(NotificationsController), Array)
#6 /var/www/html/site/lib/Cake/Routing/Dispatcher.php(186): Controller->invokeAction(Object(CakeRequest))
#7 /var/www/html/site/lib/Cake/Routing/Dispatcher.php(161): Dispatcher->_invoke(Object(NotificationsController), Object(CakeRequest), Object(CakeResponse))
#8 /var/www/html/site/app/webroot/index.php(102): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#9 {main}
2013-03-06 09:15:05 Error: Fatal Error (256): [CakeException] Unknown status code
#0 /var/www/html/site/lib/Cake/Error/ExceptionRenderer.php(212): CakeResponse->statusCode(13)
#1 [internal function]: ExceptionRenderer->error400(Object(SocketException))
#2 /var/www/html/site/lib/Cake/Error/ExceptionRenderer.php(175): call_user_func_array(Array, Array)
#3 /var/www/html/site/lib/Cake/Error/ErrorHandler.php(122): ExceptionRenderer->render()
#4 [internal function]: ErrorHandler::handleException(Object(SocketException))
#5 {main} in [/var/www/html/site/lib/Cake/Error/ErrorHandler.php, line 131]
2013-03-06 09:15:05 Error: [InternalErrorException] Internal Server Error
Request URL: /notifications/sendContact
Stack Trace:
#0 /var/www/html/site/lib/Cake/Error/ErrorHandler.php(183): ErrorHandler::handleFatalError(256, '[CakeException]...', '/var/www/html/p...', 131)
#1 [internal function]: ErrorHandler::handleError(256, '[CakeException]...', '/var/www/html/p...', 131, Array)
#2 /var/www/html/site/lib/Cake/Error/ErrorHandler.php(131): trigger_error('[CakeException]...', 256)
#3 [internal function]: ErrorHandler::handleException(Object(SocketException))
#4 {main}
2013-03-06 09:15:05 Error: Fatal Error (256): [CakeException] Unknown status code
#0 /var/www/html/site/lib/Cake/Error/ExceptionRenderer.php(212): CakeResponse->statusCode(13)
#1 [internal function]: ExceptionRenderer->error400(Object(SocketException))
#2 /var/www/html/site/lib/Cake/Error/ExceptionRenderer.php(175): call_user_func_array(Array, Array)
#3 /var/www/html/site/lib/Cake/Error/ErrorHandler.php(122): ExceptionRenderer->render()
#4 [internal function]: ErrorHandler::handleException(Object(SocketException))
#5 {main} in [/var/www/html/site/lib/Cake/Error/ErrorHandler.php, line 131]
2013-03-06 09:15:05 Error: [InternalErrorException] Internal Server Error
Request URL: /notifications/sendContact
Stack Trace:
#0 /var/www/html/site/lib/Cake/Error/ErrorHandler.php(183): ErrorHandler::handleFatalError(256, '[CakeException]...', '/var/www/html/p...', 131)
#1 [internal function]: ErrorHandler::handleError(256, '[CakeException]...', '/var/www/html/p...', 131, Array)
#2 /var/www/html/site/lib/Cake/Core/App.php(926): call_user_func('ErrorHandler::h...', 256, '[CakeException]...', '/var/www/html/p...', 131, Array)
#3 /var/www/html/site/lib/Cake/Core/App.php(899): App::_checkFatalError()
#4 [internal function]: App::shutdown()
#5 {main}
email.php
public $gmail = array(
'transport' => 'Smtp',
'from' => array('patric.....#gmail.com' => 'Patrick Maciel'),
'port'=>'465',
'timeout'=>'30',
'auth' => true,
'host' => 'ssl://smtp.gmail.com',
'username'=>'patrick......#gmail.com',
'password'=>'.......',
'client' => null,
'log' => false
);
php info (centOs)
-bash-4.1# yum info php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.globo.com
* epel: mirror.globo.com
* extras: mirror.globo.com
* updates: mirror.globo.com
Installed Packages
Name : php
Arch : i686
Version : 5.4.12
Release : 1.el6.remi
Size : 8.2 M
Repo : installed
From repo : remi
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP and Zend and BSD
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated web pages. PHP also
: offers built-in database integration for several commercial and
: non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.
Available Packages
Name : php
Arch : i386
Version : 5.3.22
Release : 1.w5
Size : 1.3 M
Repo : webtatic
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated web pages. PHP also
: offers built-in database integration for several commercial and
: non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.
-bash-4.1# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
libxml
mbstring
mcrypt
memcache
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
pspell
readline
recode
Reflection
session
shmop
SimpleXML
snmp
sockets
SPL
sqlite3
standard
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
-bash-4.1#
Apparently your PHP is not allowed to connect to the specified SMTP server. Did you properly configure your email-settings? (SMTP server, port, username, password etc).
A template for these settings is included with CakePHP in the file: app/Config/email.php.default (https://github.com/cakephp/cakephp/blob/2.2.7/app/Config/email.php.default)
You need to copy this file to app/Config/email.php and modify the settings for your environment.
After that, you'll have to specify the right configuration when sending emails
A more thorough explanation can be found in the manual:
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html#configuration
update
Another option is that SELinux security-bits dissallow PHP/Apache to make network connections.
There are several security-bits, but this seems a likely candidate: httpd_can_network_connect .
You can temporarily allow PHP/Apache to make network connections using this:
setsebool httpd_can_network_connect
And make the setting 'permanent' using the -P parameter;
setsebool -P httpd_can_network_connect
For an overview of all SELibux booleans;
http://wiki.centos.org/TipsAndTricks/SelinuxBooleans
getsebool -a
Check httpd_can_network_connect
if off, set it to on
setsebool -P httpd_can_network_connect on
It works for me !!