installing PHPCI

746 views
Skip to first unread message

Leandro Oliveira

unread,
Nov 27, 2013, 12:55:19 PM11/27/13
to php...@googlegroups.com
Hi, Guys!!


I'm new here and sorry about English =/


I'm starting to use PHPCI and running the cli install, I get the Warning below:

PHP Warning:  file_get_contents(/home/leandroleite/Projects/PHPCI/PHPCI/config.yml): failed to open stream: No such file or directory in /home/leandroleite/Projects/PHPCI/vendor/block8/b8framework/b8/Config.php on line 43
PHP Stack trace:
PHP   1. {main}() /home/leandroleite/Projects/PHPCI/console:0
PHP   2. require() /home/leandroleite/Projects/PHPCI/console:13
PHP   3. b8\Config->loadYaml() /home/leandroleite/Projects/PHPCI/bootstrap.php:51
PHP   4. file_get_contents() /home/leandroleite/Projects/PHPCI/vendor/block8/b8framework/b8/Config.php:43

Warning: file_get_contents(/home/leandroleite/Projects/PHPCI/PHPCI/config.yml): failed to open stream: No such file or directory in /home/leandroleite/Projects/PHPCI/vendor/block8/b8framework/b8/Config.php on line 43


   
but the "PHPCI/config.yml" file not exists in git repo and is ignored in ".gitignore" file, someone can guide me about the composition of the config.yml?

Haydar Ciftci

unread,
Nov 28, 2013, 8:57:22 AM11/28/13
to php...@googlegroups.com
Hi Leandro

Besides of this issue, there are also more warnings that will be displayed. If you follow the exact instruction on https://github.com/Block8/PHPCI/wiki/Installing-PHPCI you can ignore this warning.

Regards

Oliveira, Leandro

unread,
Nov 28, 2013, 10:56:53 AM11/28/13
to Haydar Ciftci, php...@googlegroups.com
Thanks Haydar!

One more, i see the project has not many unit tests, and i want to contribute.
Has some work in progress about tests? can I initialize it? that possibility is interesting?

Thanks again. 


--
You received this message because you are subscribed to a topic in the Google Groups "PHP CI" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-ci/r9DGhdTnRaU/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to php-ci+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Atenciosamente,

Leandro Leite Pinto de Oliveira

about.me/lleitep3

leandroleite.info

 Web Developer


Steve Brazier

unread,
Nov 28, 2013, 11:02:08 AM11/28/13
to Oliveira, Leandro, Haydar Ciftci, php...@googlegroups.com
There is a Tests/ directory in the root that contains the limited unit tests we have at the moment. 

At the moment it barely covers anything so this is an area we really need to improve upon so I think any contributions would be welcome. Some of the code may need re-factoring to make it a bit more testable.

I've got a unit-testing branch on my fork of the repo but I've not had a chance to make much progress on this recently.

~ Steve


--
You received this message because you are subscribed to the Google Groups "PHP CI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-ci+un...@googlegroups.com.

Oliveira, Leandro

unread,
Nov 28, 2013, 11:09:27 AM11/28/13
to Steve Brazier, Haydar Ciftci, php-ci
Cool Steve!

So I'll start it with your!

Let's code! and Success to the Project!!

Jim Mullen

unread,
May 7, 2014, 10:44:37 PM5/7/14
to php...@googlegroups.com
I'm getting the exact same error.  I followed the instructions at https://github.com/Block8/PHPCI/wiki/Installing-PHPCI .  Step 1 seemed to go fine.  I get that error on step 2.  I'm installing on a Linux box with PHP 5.3.3.  Please advise how to get past this error to "install" phpci.

meadsteve

unread,
May 8, 2014, 4:47:20 AM5/8/14
to php...@googlegroups.com
Hi Jim,

Does the user executing "./console phpci:install" have write access to the phpci directory? This script should create the yml file. So my first thought is that if it can't access it then it may not have been created correctly. Do you get any other warnings before this error?

~ Steve

Michał Łukaszewski

unread,
May 8, 2014, 5:41:34 AM5/8/14
to php...@googlegroups.com
Hi,

In my opinion the problem is in bootstrap.php
Look for this sequence:

$configFile = dirname(__FILE__) . '/PHPCI/config.yml';

if (!file_exists($configFile)) {
    $configEnv = getenv('phpci_config_file');

    if (!empty($configEnv)) {
        $configFile = $configEnv;
    }
}

If config.yml doesn't exists variable $configFile contains original path to file.
Then:

$config = new b8\Config($conf);
$config->loadYaml($configFile);

Config object initialized with default $conf values, but constructor of Config in this case only fills up Config::$config field.
There is no place in this flow where config.yml is save, but bootstrap.php calls Config::loadYaml method. This method has no error handling for "no-conf" case, however it doesn't check Config::$config data. So the crash is inevitable.

greetings,
Michał

Jim Mullen

unread,
May 8, 2014, 7:50:50 AM5/8/14
to php...@googlegroups.com
Hi Steve,

I'm running the ./console command as root so write access shouldn't be a problem.  I'm not getting any other warnings or errors.  Below is the exact error message I'm getting:
[root@host2 testphpci]# ./console phpci:install                                                                                                                                                 
[2014-05-08 11:43:10] _.ERROR: ErrorException: Warning: file_get_contents(/home/phpci/testphpci/PHPCI/config.yml): failed to open stream: No such file or directory in /home/phpci/testphpci/vendor/block8/b8framework/b8/Config.php line 43 (uncaught exception) at /home/phpci/testphpci/vendor/block8/b8framework/b8/Config.php line 43 {"exception":"[object] (ErrorException: Warning: file_get_contents(/home/phpci/testphpci/PHPCI/config.yml): failed to open stream: No such file or directory in /home/phpci/testphpci/vendor/block8/b8framework/b8/Config.php line 43 at /home/phpci/testphpci/vendor/block8/b8framework/b8/Config.php:43)"} []

 One interesting side note, I just ran the script at 7:43 am ET to get the error above but the timestamp at the beginning of the error message shows 4 hours later.

Jim Mullen

unread,
May 8, 2014, 7:54:34 AM5/8/14
to php...@googlegroups.com
Hi Michal,

Based on the exception that's being thrown, I think you may be on the right track.  I would guess that this is happening to anyone who's trying to install phpci.  Should I open an issue for this?

Best regards,
Jim Mullen

Dan Cryer

unread,
May 8, 2014, 7:57:31 AM5/8/14
to Jim Mullen, php...@googlegroups.com

I'll dig into it and get v1.1 patched in the next hour or so. Thanks Jim.

Dan

--
You received this message because you are subscribed to the Google Groups "PHP CI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-ci+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michał Łukaszewski

unread,
May 8, 2014, 7:59:17 AM5/8/14
to php...@googlegroups.com
Hi Jim,

I think we should wait for Steve opinion. If there is a bug then I or you will create formal issue.

Dan Cryer

unread,
May 8, 2014, 8:38:35 AM5/8/14
to Jim Mullen, php...@googlegroups.com
Version 1.1 has been patched and the release updated on Github: https://github.com/Block8/PHPCI/releases/tag/1.1.0

You should be able to do a git pull and the installer will work as expected.

Thanks

Dan




Dan Cryer

Tel: 01625 837 395
Mobile: 07590 698 944

Michał Łukaszewski

unread,
May 8, 2014, 8:40:13 AM5/8/14
to php...@googlegroups.com, Jim Mullen
Thx Dan, now works fine :)

Jim Mullen

unread,
May 8, 2014, 8:28:29 PM5/8/14
to php...@googlegroups.com, Jim Mullen
Thx for the patch Dan!  That error is gone, but now I'm getting a different error:

PHP Parse error:  syntax error, unexpected '[' in /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php on line 40
[2014-05-09 00:24:56] _.ERROR: ErrorException: 4: syntax error, unexpected '[' in /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php line 40 (uncaught exception) at /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php line 40 {"exception":"[object] (ErrorException: 4: syntax error, unexpected '[' in /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php line 40 at /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php:40)"} []

Jim Mullen

unread,
May 8, 2014, 8:43:57 PM5/8/14
to php...@googlegroups.com, Jim Mullen
Issue is that the [ ] array syntax seems to not be recognized.  When I change it to array( ) syntax I get past the error.  I'm on PHP 5.3.3.  What version of PHP was the [ ] syntax introduced?

Jim Mullen

unread,
May 8, 2014, 8:46:08 PM5/8/14
to php...@googlegroups.com, Jim Mullen
[ ] syntax was not introduced until 5.4.  So minimum requirements should be changed to PHP 5.4 or change all arrays to array ( ) syntax.

Jim Mullen

unread,
May 8, 2014, 9:03:17 PM5/8/14
to php...@googlegroups.com, Jim Mullen
Next issue...get to the point where I enter my admin password and name and I get the error:

PHPCI failed to create your admin account.
Hash must be a string.

Unfortunately password_hash is only available for PHP versions >= 5.5.0.  So, now minimum requirements go to 5.5.0 unless that code is changed too.

Jim Mullen

unread,
May 8, 2014, 9:19:22 PM5/8/14
to php...@googlegroups.com, Jim Mullen
I do see that the vendor library ircmaxell/password-compat/lib/password.php so I should have that password_hash function and crypt is available. So, not sure what's going on here.  Thoughts?

Dan Cryer

unread,
May 9, 2014, 2:04:00 AM5/9/14
to Jim Mullen, php...@googlegroups.com
Hi Jim

Going to send a couple of responses answering specific emails:

Issue is that the [ ] array syntax seems to not be recognized.  When I change it to array( ) syntax I get past the error.  I'm on PHP 5.3.3.  What version of PHP was the [ ] syntax introduced?

I've fixed this issue, and pushed it to master - It'll be resolved in the next release (though you could just git pull from master to get it now). 

 

On Thursday, May 8, 2014 8:28:29 PM UTC-4, Jim Mullen wrote:
Thx for the patch Dan!  That error is gone, but now I'm getting a different error:

PHP Parse error:  syntax error, unexpected '[' in /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php on line 40
[2014-05-09 00:24:56] _.ERROR: ErrorException: 4: syntax error, unexpected '[' in /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php line 40 (uncaught exception) at /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php line 40 {"exception":"[object] (ErrorException: 4: syntax error, unexpected '[' in /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php line 40 at /home/phpci/testphpci/PHPCI/Command/GenerateCommand.php:40)"} []

Dan Cryer

unread,
May 9, 2014, 2:14:55 AM5/9/14
to Jim Mullen, php...@googlegroups.com

I do see that the vendor library ircmaxell/password-compat/lib/password.php so I should have that password_hash function and crypt is available. So, not sure what's going on here.  Thoughts?


On Thursday, May 8, 2014 9:03:17 PM UTC-4, Jim Mullen wrote:
Next issue...get to the point where I enter my admin password and name and I get the error:

PHPCI failed to create your admin account.
Hash must be a string.


You've got me stumped with this one - I assume you have entered a password when prompted? and no other errors were displayed in the console?

Could you try setting PHP to log errors (temporarily) and then run it again and see if anything gets logged? The password_compat library is pretty good at throwing sensible errors when it fails.

Also if you're still having trouble, please can you tell us: What OS (and version) you're running on and what version of PHP?

Thanks

Dan

meadsteve

unread,
May 9, 2014, 4:55:40 AM5/9/14
to php...@googlegroups.com, Jim Mullen
Hey,

Just to chip in. My first thought on the "Hash must be a string." error is that something is wrong with the password hashing. password_hash() returns FALSE when something went wrong. As far as I'm aware the only requirement for bcrypt is to be on version 5.3.8 or higher but it might be worth digging in to this and seeing if there are any other requirements that could cause failure.

~ Steve

Jim Mullen

unread,
May 9, 2014, 7:39:46 AM5/9/14
to php...@googlegroups.com, Jim Mullen
Thx for the array fix.  Pulled and verified that worked.

Yeah, I entered a password (tried both alpha-numeric and just alpha lowercase).  No other errors were displayed on the console.

I'll try to get the PHP CLI logging turned on Sat.  I'm using a Debian derivative called SimplyMepis...I believe its version 6.  I have PHP ver. 5.3.3.

Steve Brazier

unread,
May 9, 2014, 8:37:41 AM5/9/14
to Jim Mullen, php...@googlegroups.com
Your version of php may well be the problem. There's a flaw in the bcrypt implementation in earlier versions of php  (<5.3.8). We've updated the project to require this and I strongly suggest you upgrade your version of php.

~ Steve


Reply all
Reply to author
Forward
0 new messages