How to successfully migrate a Zend Framework 1 application from CloudControl Luigi to the Pinky stack?

The simple part ...

Typically, when porting a ZF1 application from built-in automatic loading to composer-based automatic loading (which is highly recommended for deployment on the CloudControls Pinky stack), you just need to take a few simple steps:

Create a composer.json file and require the Zend Framework (e.g. latest version from version 1.12) with

{
    "require" : {
        "zendframework/zendframework1" : "1.12.*"
    }
}

Set composer dependencies through CLI with

composer install

Update the .gitignore file and add:

vendor/*

Recursively delete the current ZF folder from your library path (for example, ./library):

rm -r library/Zend

Include composer autoloader in index.php before any use of classes Zend_by adding:

$loader = include 'vendor/autoload.php';

, ZF require require_once index.php - . :

require_once 'Zend/Application.php';

, git , CloudControl CLI ( APP_NAME DEP_NAME )

cctrlapp APP_NAME/DEP_NAME deploy

, cctrlapp , , . , , :

cctrlapp APP_NAME/DEP_NAME log deploy

, - - !

f ***! ? ?? LA (M) P.

+4
1

...

, CloudControl ...

cctrlapp APP_NAME/DEP_NAME log error

, .

... err...

8/1/14 5:23 AM  error [error] [client ] FastCGI: incomplete headers (0 bytes) received from server "/app/php/box/php-fpm"
8/1/14 5:23 AM  error [error] [client ] (104)Connection reset by peer: FastCGI: comm with server "/app/php/box/php-fpm" aborted: read failed

, , . ! Google. - . . google . . . . . ... ?

, Pinky ( ). - , , - CLI :

cctrlapp APP_NAME/DEP_NAME run bash

CloudControl SSH. , , :

cloudControl , SSH . , SSH.

- , SSH Procfile. , .

, ( ):

cd code/public
php index.php

... ... ... ?! ?!!

, - ! , index.php :

vi index.php

- :

8/1/14 8:55 AM  error [error] [client ] FastCGI: server "/app/php/box/php-fpm" stderr: PHP message: PHP Fatal error:  require_once(): Failed opening required '' (include_path='/srv/www/code/vendor/zendframework/zendframework1/library:/srv/www/code/library:.:/usr/share/php') in /srv/www/code/vendor/zendframework/zendframework1/library/Zend/ ...
8/1/14 8:55 AM  error [error] [client ] FastCGI: server "/app/php/box/php-fpm" stderr: PHP message: PHP Warning: require_once(/srv/www/code/vendor/zendframework/zendframework1/library): failed to open stream: No such file or directory in /srv/www/code/vendor/zendframework/zendframework1/library/Zend/ ...

, - - , - .

, : Failed opening required ''? , !

... ZF . - , - .


PHP!

, PECL APC, Pinky PHP 5.4.30/ APC 3.1.13 - .:

https://bugs.php.net/bug.php?id=62398

, run - php.ini apc.stat ​​ 0 (off) - 1 (on) .


TL;DR

CloudControl Pinky PHP buildpack GitHub:

git clone https://github.com/cloudControl/buildpack-php.git

:

.buildpack/php

.buildpack/php/conf/php.ini :

apc.stat = 1

, , !


:

, , stat APC ( ), . PHP:

, script , .


:

, CloudControl - , . , @BullfrogBlues @Thierry_Marianne , Stack Overflow, , , , , , , APC.

+5
source

All Articles