Custom PHP 5.3.1 with APC and XDEBUG on (Dreamhost) Shared Host

I’ve recently been setting up my new dreamhost for symfony projects deployment and the only thing the default PHP is missing is the support for APC (alternate php cache). So after looking at the dreamhost wiki I cleaned up and added some features to the one of the install scripts. Here it is for your/mine (future) commodity.

Tagged with: , , ,
Posted in Web Development
20 Comments » for Custom PHP 5.3.1 with APC and XDEBUG on (Dreamhost) Shared Host
  1. Emmanuele says:

    does this script create a custom php install with APC working by itself or do I need to modify something else to make it work? I’d like to use APC for magento and all the other scripts for installing php and APC on dreamhost failed to install…

    • marco says:

      well, you should be able to run it as it is, but you might want to have a look at the 3 “#@todo Update” lines and decide if the settings suits you.

      hope it helps

      Cheers, Marco

  2. Emmanuele says:

    Thanks a lot it works! One last question: Magento doesn’t support php5.3 very well… I’d like to install 5.2. Is it sufficient change PHP=”php-5.3.1″ to PHP=”php-5.2.12″ (for example) at the 1 “#@todo Update” or are there other settings to customize and how?
    I’d really appreciate if you could answer this question, hope it doesn’t bother you too much.
    Thanks a lot.

  3. Emmanuele says:

    Script blocks when downloading Curl, there must be something with their site cause i cannot reach it. I’ll try later and I’ll tell you.

  4. Emmanuele says:

    It blocks during Php 5.2.12 installation: this is the error -> INSTALLING PHP...

    cp: cannot stat `/home/milchstore/mycompiles/build/php-5.2.12/php.ini-production': No such file or directory

  5. marco says:

    hi, it means that it cannot find the php.ini-production file in the $BUILDDIR.
    Check line 245 and adapt it to php.ini-recommended or php.ini-dist (depending on your needs)


  6. dave says:

    Is it just me or is APC not actually functional? I see that it is enabled, however if you look at apc.php there is never any entries other than apc.php itself, and apc start time is the whenever the script ran. I’m sure there is a way around this, but what am I missing?

    • marco says:

      mmm haven’t had a chance to play with apc (and I’m no apc expert either…) since then due to lack of time… i just cleaned up the install script using the settings from the scripts on wiki.dreamhost but looking at a phpinfo it all seams to work… i’ll have a look asap

  7. dave says:

    yea, it works fine, except i believe php as cgi runs as a new instance of php each time, hence no shared memory. (well that’s what I’ve gathered from other research I’ve done)

    Take a look at that apc.php file, the output will let you know whether apc is doing anything for you or not

    Thanks for your efforts btw, the script worked great.

  8. dave says:

    According to this:

    One needs to do quite a bit more to get PC properly functioning with PHP /fastcgi. I don’t think those steps are possible as a user account on dreamhost, but if someone knows better, I’m all ears.

  9. lsowen says:

    Thank you for putting this together… It really helped me out!

  10. Daniel says:

    Hi, Im getting the following error, no idea what to do, any advice?

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

  11. ahaab says:

    i get a lot of errors after the php licence notification. posted everything to pastebin here.
    any ideas?

    thanks in advance!

  12. MacMladen says:

    I use Drupal and some modules would like to have PECL upload progress.

    How could it be added to build script and can you provide a solution for such integration?

  13. GeorgeK says:

    Did anyone use this installation to debug with Xdebug ?

    I use the following configuration in the php.ini

    Alas I it doesn’t work and before I spend more time on it I would like to know if this port opening is even allowed?

    Any help will be very welcomed

  14. GeorgeK says:

    My message got scrambled, as stated I using the following configuration in the php.ini

    end_extension_ts=[absolute path to]
    xdebug.remote_host=[domain name]
    xdebug.remote_port=[port of my choosing]

  15. marco says:

    @daniel suggests using a UNIX texteditor to avoid this problem, are you working your files on a win machine and then uploading them?

    @MacMladen you can remove the –without-pear switch on line 92 so your php will have pear and you can use PECL

    @GeorgeK I did play around a bit but not much. (short in time….)

  16. Typically I actually do not post on weblogs, although I would like to state that this article seriously obligated me to do so! nice post.

  17. Gary says:

    I got the script to run without errors, but APC is not showing up as installed. Any suggestions? Is there steps not listed here that I was supposed to follow? Thanks!

Leave a Reply

Contact GmbH
Mythenstrasse 37A
8840 Einsiedeln

Email: [email protected]
Twitter: @OPENGISch
Mobile: +41 (0)79 467 24 70
Skype: mbernasocchi
Support QField development
%d bloggers like this: