Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP DEBUG versions #11

Closed
inquam opened this issue Mar 13, 2017 · 12 comments
Closed

PHP DEBUG versions #11

inquam opened this issue Mar 13, 2017 · 12 comments

Comments

@inquam
Copy link

inquam commented Mar 13, 2017

I noticed that the PHP versions built are DEBUG versions. I was going to use this for a local development image. So I modified it a bit. But how do I make it build RELEASE builds of PHP? I wanted to use Z-Ray with the supported versions but that doesn't work with DEBUG builds.

@splitbrain
Copy link
Owner

No idea what z-ray is. The builds include xdebug and enable it by default. I guess it should be possible to disable xdebug through a local php.ini as described in the documentation.

@inquam
Copy link
Author

inquam commented Mar 13, 2017

z-ray is a zend extension to php that gives you information about the request like function calls, memory consumption, db querys etc. http://www.zend.com/en/products/server/z-ray

x-debug doesn't require a debug build of PHP as far as I can recall? I have added it to non debug builds of php before. As far as I recall the debug symbols of php are only needed to debug php itself, when you work on the core for instance develop your own extensions etc.

@splitbrain
Copy link
Owner

Hmm I'm not explicitly enable any debug flags: https://github.com/splitbrain/docker-phpfarm/blob/master/phpfarm/custom-options.sh

And the options set by phpfarm do not to do either: https://github.com/cweiske/phpfarm/blob/master/src/options.sh

What makes you think they are compiled with debug symbols? Does phpinfo() mention it?

@inquam
Copy link
Author

inquam commented Mar 13, 2017

Running bash on the image and checking the versions of the built php versions.

 root@4d1efc6c58e2:/phpfarm/inst/php-5.6.29/bin# pwd
 /phpfarm/inst/php-5.6.29/bin
 root@4d1efc6c58e2:/phpfarm/inst/php-5.6.29/bin# ./php -v
 PHP 5.6.29 (cli) (built: Mar 10 2017 14:52:01) (DEBUG)
 Copyright (c) 1997-2016 The PHP Group
 Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
     with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans

As you can see it's clearly marked as (DEBUG)

@splitbrain
Copy link
Owner

Hmm weird. I guess we need some --no-debug build flag or something? Pull request welcome.

@inquam
Copy link
Author

inquam commented Mar 13, 2017

No that doesn't seem to be a valid flag. The environment variable DEBUG can also make sure debug builds are built. But can't see that being set anywhere either.

@eugenesia
Copy link
Collaborator

eugenesia commented Mar 17, 2017

I think the PHPFarm compile script is the one that inserted the --enable-debug flag? See https://github.com/cweiske/phpfarm/blob/master/src/compile.sh#L116

That flag seems to be hardcoded in compile.sh and cannot be overridden using custom options files, so you probably have to modify the PHPFarm compile script.

There is another more updated fork of the PHPFarm script here https://github.com/fpoirotte/phpfarm . This allows you to disable the --enable-debug flag using the version string, see https://github.com/fpoirotte/phpfarm#special-flags-in-version-strings . You may wish to use that instead?

I might create a version of this repo using the more updated PHPFarm script if I have time, but don't hold your breath!

@splitbrain
Copy link
Owner

That fork looks interesting. I'm looking into it right now... it does not work right out of the box as replacement, so I have to figure out what to adjust.

@splitbrain
Copy link
Owner

I just pushed a branch that makes use of the fork. Took me a while but it seems to work now. Could you try it before I merge it into master?

@inquam
Copy link
Author

inquam commented Mar 20, 2017

I'll check it out. I manually made it strip --enable-debug from the compile.sh script and that worked fine to. But I'll give your fork a go asap.

@eugenesia
Copy link
Collaborator

Thanks @splitbrain I tried the fpoirotte branch with Dockerfile-Jessie, it seems to work fine and indicates it's NOT a debug build:

root@3c002eedf6bb:/phpfarm/inst/php-5.3.29/bin# ./php --version
PHP 5.3.29 (cli) (built: Mar 22 2017 12:00:29)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans

I'll try the Dockerfile-Wheezy version next.

@eugenesia
Copy link
Collaborator

Hi @splitbrain I tried the fpoirotte branch with Dockerfile-Wheezy. The build took a long time 😂 but I loaded index.php for the different PHP versions and all reported NO debug build. I also tested with PHP CLI, see below.

root@11d77e36344b:/phpfarm/inst/php-5.2/bin# ./php --version
PHP 5.2.17 (cli) (built: Mar 23 2017 10:16:18)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans

I guess we're good to go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants