Community Buzz

Install Your Own PHP 5 on Your Web Host


Dreamhost runs PHP 5.1.2 by default. I wanted to upgrade to 5.2.0, be able to set my memory to something other than the standard 8M, use GD with Freetype and most of all have all of the improvements in PHP5 that come with version 5.2.0. One added PHP 5.2.0 feature was built-in JSON support which I just had to check out. But most importantly get an editable copy of php.ini.

This is the first in a series of tutorials on how to setup PHP5 on a web host that allows you to compile your own software. In my case it is Dreamhost but you may also be able to do this at Site5 Hositng, TextDrive and many others.

The Dreamhost wiki provided a needed shell script that would allow me to compile and install my own version of PHP 5. A few things happened on the road to successfully installing php5 to a directory under my account. First the script would not run. Then I could not change the PHP memory limit and there was no Freetype support in GD and of course the script just did not run. I spent an afternoon reading over the wiki and did some heavy head scratching before being able to cobble together a shell script that worked.

Get started by saving the following code to *.sh. FTP upload the script to your account root. Then set the permissions via FTP to 755. Start putty or whatever shell gui you are using and run the script in your shell by typing ./nameofscript.sh. If problems are encountered the script will stop. Fix the problems and run the script again. I have run this script several times without any errors. But is perfect. This is a much better and less time consuming way of using SHELL. Typing line by line and troubleshooting along the way is only for the sadistic.

#!/bin/sh

# Abort on any errors
set -e

# The domain in which to install the PHP CGI script.
export DOMAIN="demo.hiveminds.co.uk"

# Where do you want all this stuff built? I'd recommend picking a local
# filesystem.
# ***Don't pick a directory that already exists!***  We clean up after
# ourselves at the end!
SRCDIR=${HOME}/source

# And where should it be installed?
INSTALLDIR=${HOME}/php5

# Set DISTDIR to somewhere persistent, if you plan to muck around with this
# script and run it several times!
DISTDIR=${HOME}/dist

# Pre-download clean up!!!!
rm -fr $SRCDIR $DISTDIR

# Update version information here.
PHP5="php-5.2.0"
LIBICONV="libiconv-1.11"
LIBMCRYPT="libmcrypt-2.5.7"
LIBXML2="libxml2-2.6.27"
LIBXSLT="libxslt-1.1.18"
MHASH="mhash-0.9.7.1"
ZLIB="zlib-1.2.3"
CURL="curl-7.14.0"
LIBIDN="libidn-0.6.8"
CCLIENT="imap-2004g"
CCLIENT_DIR="imap-2004g" # Another pest!
FREETYPE="freetype-2.2.1"

# What PHP features do you want enabled?
PHPFEATURES="--prefix=${INSTALLDIR} \
 --with-config-file-path=${INSTALLDIR}/etc/php5/${DOMAIN} \
 --enable-force-cgi-redirect \
 --with-xml \
 --with-libxml-dir=${INSTALLDIR} \
 --with-freetype-dir=${INSTALLDIR} \
 --enable-soap \
 --with-openssl=/usr \
 --with-mhash=${INSTALLDIR} \
 --with-mcrypt=${INSTALLDIR} \
 --with-zlib-dir=${INSTALLDIR} \
 --enable-fastcgi \
 --with-jpeg-dir=/usr \
 --with-png-dir=/usr \
 --with-gd \
 --enable-gd-native-ttf \
 --enable-memory-limit
 --enable-ftp \
 --with-exif \
 --enable-sockets \
 --enable-wddx \
 --with-iconv=${INSTALLDIR} \
 --enable-sqlite-utf8 \
 --enable-calendar \
 --with-curl=${INSTALLDIR} \
 --enable-mbstring \
 --enable-mbregex \
 --with-mysql=/usr \
 --with-mysqli \
 --without-pear \
 --with-gettext \
 --with-imap=${INSTALLDIR} \
 --with-imap-ssl=/usr"

# ---- end of user-editable bits. Hopefully! ----

# Push the install dir's bin directory into the path
export PATH=${INSTALLDIR}/bin:$PATH

#setup directories
mkdir -p ${SRCDIR}
mkdir -p ${INSTALLDIR}
mkdir -p ${DISTDIR}
cd ${DISTDIR}

# Get all the required packages
wget -c http://us3.php.net/distributions/${PHP5}.tar.gz
wget -c http://mirrors.usc.edu/pub/gnu/libiconv/${LIBICONV}.tar.gz
wget -c http://easynews.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz
wget -c ftp://xmlsoft.org/libxml2/${LIBXML2}.tar.gz
wget -c ftp://xmlsoft.org/libxml2/${LIBXSLT}.tar.gz
wget -c http://superb-west.dl.sourceforge.net/sourceforge/mhash/${MHASH}.tar.gz
wget -c http://www.zlib.net/${ZLIB}.tar.gz
wget -c http://curl.haxx.se/download/${CURL}.tar.gz
wget -c http://kent.dl.sourceforge.net/sourceforge/freetype/${FREETYPE}.tar.gz
wget -c ftp://alpha.gnu.org/pub/gnu/libidn/${LIBIDN}.tar.gz
wget -c ftp://ftp.cac.washington.edu/imap/old/${CCLIENT}.tar.Z

echo ---------- Unpacking downloaded archives. This process may take several minutes! ----------

cd ${SRCDIR}
# Unpack them all
echo Extracting ${PHP5}...
tar xzf ${DISTDIR}/${PHP5}.tar.gz
echo Done.
echo Extracting ${LIBICONV}...
tar xzf ${DISTDIR}/${LIBICONV}.tar.gz
echo Done.
echo Extracting ${LIBMCRYPT}...
tar xzf ${DISTDIR}/${LIBMCRYPT}.tar.gz
echo Done.
echo Extracting ${LIBXML2}...
tar xzf ${DISTDIR}/${LIBXML2}.tar.gz
echo Done.
echo Extracting ${LIBXSLT}...
tar xzf ${DISTDIR}/${LIBXSLT}.tar.gz
echo Done.
echo Extracting ${MHASH}...
tar xzf ${DISTDIR}/${MHASH}.tar.gz
echo Done.
echo Extracting ${ZLIB}...
tar xzf ${DISTDIR}/${ZLIB}.tar.gz
echo Done.
echo Extracting ${CURL}...
tar xzf ${DISTDIR}/${CURL}.tar.gz
echo Done.
echo Extracting ${LIBIDN}...
tar xzf ${DISTDIR}/${LIBIDN}.tar.gz
echo Done.
echo Extracting ${CCLIENT}...
uncompress -cd ${DISTDIR}/${CCLIENT}.tar.Z |tar x
echo Done.
echo Extracting ${FREETYPE}...
tar xzf ${DISTDIR}/${FREETYPE}.tar.gz
echo Done.

# Build them in the required order to satisfy dependencies.

#libiconv
cd ${SRCDIR}/${LIBICONV}
./configure --enable-extra-encodings --prefix=${INSTALLDIR}
# make clean
make
make install

#libxml2
cd ${SRCDIR}/${LIBXML2}
./configure --with-iconv=${INSTALLDIR} --prefix=${INSTALLDIR}
# make clean
make
make install

#libxslt
cd ${SRCDIR}/${LIBXSLT}
./configure --prefix=${INSTALLDIR} \
 --with-libxml-prefix=${INSTALLDIR} \
 --with-libxml-include-prefix=${INSTALLDIR}/include/ \
 --with-libxml-libs-prefix=${INSTALLDIR}/lib/
# make clean
make
make install

#zlib
cd ${SRCDIR}/${ZLIB}
./configure --shared --prefix=${INSTALLDIR}
# make clean
make
make install

#libmcrypt
cd ${SRCDIR}/${LIBMCRYPT}
./configure --disable-posix-threads --prefix=${INSTALLDIR}
# make clean
make
make install

#libmcrypt lltdl issue!!
cd  ${SRCDIR}/${LIBMCRYPT}/libltdl
./configure --prefix=${INSTALLDIR} --enable-ltdl-install
# make clean
make
make install

#mhash
cd ${SRCDIR}/${MHASH}
./configure --prefix=${INSTALLDIR}
# make clean
make
make install

#freetype
cd ${SRCDIR}/${FREETYPE}
./configure --prefix=${INSTALLDIR}
# make clean
make
make install

#libidn
cd ${SRCDIR}/${LIBIDN}
./configure --with-iconv-prefix=${INSTALLDIR} --prefix=${INSTALLDIR}
# make clean
make
make install

#cURL
cd ${SRCDIR}/${CURL}
./configure --with-ssl=${INSTALLDIR} --with-zlib=${INSTALLDIR} \
  --with-libidn=${INSTALLDIR} --enable-ipv6 --enable-cookies \
  --enable-crypto-auth --prefix=${INSTALLDIR}
# make clean
make
make install

# c-client
cd ${SRCDIR}/${CCLIENT_DIR}
make ldb
# Install targets are for wusses!
cp c-client/c-client.a ${INSTALLDIR}/lib/libc-client.a
cp c-client/*.h ${INSTALLDIR}/include

#PHP 5
cd ${SRCDIR}/${PHP5}
./configure ${PHPFEATURES}
# make clean
make
make install

#copy config file
mkdir -p ${INSTALLDIR}/etc/php5/${DOMAIN}
cp ${SRCDIR}/${PHP5}/php.ini-dist ${INSTALLDIR}/etc/php5/${DOMAIN}/php.ini

#copy PHP CGI and FCGI
mkdir -p ${HOME}/${DOMAIN}/cgi-bin
chmod 0755 ${HOME}/${DOMAIN}/cgi-bin
cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php.cgi
cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php5.fcgi
rm -fr $SRCDIR $DISTDIR
echo ---------- INSTALL COMPLETE! ----------

Here's a some of the things in the script that had to be fixed before everything came together.

  • When you compile your own PHP to get changable memory_limit you have to compile it with the ----enable-memory-limit. Otherwise you will not be able to set it via the php.ini no matter what you do.
  • Compile GD with Freetype support. GD to me is worthless without the ability to write textdynamically.
  • The script in the Dreamhost wiki uses a path to bash. Bash is not found on the server. Use sh instead.

A few words of caution. You will want to be careful about upgrading to the latest PHP version when using a CMS. Check with the CMS developers before hand. PHP 5.2.0 handles sessions in a different manner so upgrading may lock you out of your website. To get the same functionality using a lesser version number of PHP. Just change the line PHP5="php-5.2.0" to something like PHP5="php-5.1.6" before running the script.

After everything is working you may want to do a few of your other domains. So here is a little script to run to copy PHP CGI to another domain in the same account.

#!/bin/sh

# Abort on any errors
set -e

# And where should it be installed?
DOMAIN="hiveminds.co.uk"

#copy it for where?
SOURCEDOMAIN="demo.hiveminds.co.uk"

#paths
INSTALLDIR=${HOME}/php5
CGIFILE="$HOME/$SOURCEDOMAIN/cgi-bin/php.cgi"
INIFILE="$HOME/php5/etc/php5/$SOURCEDOMAIN/php.ini"

#copy config file
mkdir -p ${INSTALLDIR}/etc/php5/${DOMAIN}
cp ${INIFILE} ${INSTALLDIR}/etc/php5/${DOMAIN}/php.ini

#copy PHP CGI
mkdir -p ${HOME}/${DOMAIN}/cgi-bin
chmod 0755 ${HOME}/${DOMAIN}/cgi-bin
cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php.cgi

echo ---------- INSTALL COMPLETE! ----------

One of the nice things about running PHP as a CGI is that you can run many different instances with different versions of PHP. This means you can accomdate scripts that do not run on newer PHP versions until you get a chance to update them.

You should also take note that this script will create PHP CGI and PHP FASTCGI. This is because later there will be a script for installing eAccelerator. eAccelerator is a caching extension for PHP. It requires that PHP be run in FCGI mode. Rather than changing the name on the binary I create two of them in the same directory so switching back and forth is easy.

To turn on FastCGI and use PHP as FastCGI you will first have to go into the control panel and set the domain properties for FastCGI.

Then use the following in your .htaccess file for that domain.

# PHP 5, Apache 1 and 2
Options +ExecCGI
AddHandler fastcgi-script fcg fcgi fpl
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php5.fcgi

Cleaning house

After you compile and run your PHP5.fcgi executable you may be wondering why the file size is over 20mb. This is because there is a lot of debugging information hiding in the code. To rid yourself of this you may want to clean house by running the strip command.

strip --strip-all /[path to your php executable]/php5.fcgi

After doing so you should see about a 75% drop in the file size. Something between 6mb and 7mb is respectable. You also always want to avoid adding in extensions that you are not going to use. If for some reason you hit an extension that filters your code but does nothing you may be adding unwanted time to your script executions.

Update:I have changed the Dreamhost wiki to reflect the changes made here and adjusted the instructions for use.

Happy Publishing!

Discussion

44 comments for “Install Your Own PHP 5 on Your Web Host”

  1. Just curious, on your Dreamhost entry, you don’t have the
    –enable-fastcgi option when compiling PHP, was there any reason for this?

    Btw, great article.

    Posted by Anonymous | January 5, 2007, 23:30
  2. Those updates to this script came while trying to get fcgi to work. There are still some other pieces missing like XSL and XSLT. After the APC article and some testing I will go back and update the wiki.

    Most of the changes are coming out of doing the installs of different CMS for the Demo Matrix. I keep finding small things that need to be supported in the final compile.

    Posted by Hiveminds | January 6, 2007, 00:44
  3. I figured as much… my ultimate goal was to install eAccelerator (on Dreamhost), and without the previous mentioned flag, I kept getting Server 500 errors… with relatively cryptic error messages in my log files. It might be nice to note that you still need to enable it on the Dreamhost template.

    In any case, it’s still an excellent script and saved me a hell of a lot of time. :)

    Posted by Anonymous | January 6, 2007, 14:54
  4. I checked the size of the executable and it came up to about 20Mb. Isn’t rather large? Does all 20Mb have to be loaded into memory before a script can run?

    I thought it could be compiled in such a way that modules won’t be necessary, unless that is applicable to the Apache module only.

    Posted by voipfc | January 11, 2007, 00:07
  5. The size does not matter much because PHP scripts are interpreted not compiled. But you can get a slow interpreter by having slow extensions in the executable. So it’s best that if you don’t need an extension not to compile it in to the executable.

    Having said that you can reduce the size by stripping out the debug information with

    strip –strip-all php5.fcgi

    I updated the tutorial to reflect this.

    Posted by Anonymous | January 11, 2007, 00:46
  6. My initial question as somewhat confusing What I meant was whether the loading of the cgi executable into memory to run the script wouldn’t take too much time. I guess anyway that it is what fast cgi is meant to handle.

    In the case of the extensions I was wondering whether the cgi version can be compiled with to use .so instead of one large executable.

    In any case after I run the strip command it reduced to 6Mb

    Posted by voipfc | January 11, 2007, 02:54
  7. I am not an expert in this area, but I believe PHP5 comes with support for FastCGI already built in.

    Posted by voipfc | January 11, 2007, 02:57
  8. There is a question I want to ask about CGI.

    If the Apache Server is compiled to use mod_php, is it possible for a virtual host to use a CGI if the proper settings like ScriptAlias, ExecCGI, Add-Type etc are configured in its own settings?

    Posted by voipfc | January 11, 2007, 03:02
  9. Yes,

    As long as your server allows CGI executables then you can do this. Most servers are already configured to do Perl CGI so going with PHP CGI along side of mod_php is easy. Just make sure they use different extension types. I have my mod_php going to .php and PHP CGI going to .phtml via .htaccess.

    The nice thing about CGI is that you can run as many different version of PHP as you like. Just send the script to the one you need. With mod_php you are stuck with what the server admin installs.

    Posted by Anonymous | January 11, 2007, 14:52
  10. After running the first .sh at the end it gave this error:

    make: *** [Zend/zend_execute.lo] Error 1

    Any suggestions? Should I use the instructions at dreamhost instead?

    Posted by Anonymous | January 14, 2007, 07:04
  11. Can you post the line number or email a complete error dump to me? There may be a problem with the server or a server difference.

    Test the script at Dreamhost and see what happens.

    Posted by Hiveminds | January 14, 2007, 09:03
  12. /bin/sh /home/nite/source/php-5.2.0/libtool –silent –preserve-dup-deps –mode=compile gcc -IZend/ -I/home/nite/source/php-5.2.0/Zend/ -DPHP_ATOM_INC -I/home/nite/source/php-5.2.0/include -I/home/nite/source/php-5.2.0/main -I/home/nite/source/php-5.2.0 -I/home/nite/php5/include/libxml2 -I/home/nite/php5/include -I/home/nite/source/php-5.2.0/ext/date/lib -I/home/nite/php5/include/freetype2 -I/home/nite/source/php-5.2.0/ext/mbstring/oniguruma -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/home/nite/source/php-5.2.0/TSRM -I/home/nite/source/php-5.2.0/Zend -I/home/nite/php5/include -g -O2 -c /home/nite/source/php-5.2.0/Zend/zend_object_handlers.c -o Zend/zend_object_handlers.lo
    /bin/sh /home/nite/source/php-5.2.0/libtool –silent –preserve-dup-deps –mode=compile gcc -IZend/ -I/home/nite/source/php-5.2.0/Zend/ -DPHP_ATOM_INC -I/home/nite/source/php-5.2.0/include -I/home/nite/source/php-5.2.0/main -I/home/nite/source/php-5.2.0 -I/home/nite/php5/include/libxml2 -I/home/nite/php5/include -I/home/nite/source/php-5.2.0/ext/date/lib -I/home/nite/php5/include/freetype2 -I/home/nite/source/php-5.2.0/ext/mbstring/oniguruma -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/home/nite/source/php-5.2.0/TSRM -I/home/nite/source/php-5.2.0/Zend -I/home/nite/php5/include -g -O2 -c /home/nite/source/php-5.2.0/Zend/zend_objects_API.c -o Zend/zend_objects_API.lo
    /bin/sh /home/nite/source/php-5.2.0/libtool –silent –preserve-dup-deps –mode=compile gcc -IZend/ -I/home/nite/source/php-5.2.0/Zend/ -DPHP_ATOM_INC -I/home/nite/source/php-5.2.0/include -I/home/nite/source/php-5.2.0/main -I/home/nite/source/php-5.2.0 -I/home/nite/php5/include/libxml2 -I/home/nite/php5/include -I/home/nite/source/php-5.2.0/ext/date/lib -I/home/nite/php5/include/freetype2 -I/home/nite/source/php-5.2.0/ext/mbstring/oniguruma -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/home/nite/source/php-5.2.0/TSRM -I/home/nite/source/php-5.2.0/Zend -I/home/nite/php5/include -g -O2 -c /home/nite/source/php-5.2.0/Zend/zend_mm.c -o Zend/zend_mm.lo
    /bin/sh /home/nite/source/php-5.2.0/libtool –silent –preserve-dup-deps –mode=compile gcc -IZend/ -I/home/nite/source/php-5.2.0/Zend/ -DPHP_ATOM_INC -I/home/nite/source/php-5.2.0/include -I/home/nite/source/php-5.2.0/main -I/home/nite/source/php-5.2.0 -I/home/nite/php5/include/libxml2 -I/home/nite/php5/include -I/home/nite/source/php-5.2.0/ext/date/lib -I/home/nite/php5/include/freetype2 -I/home/nite/source/php-5.2.0/ext/mbstring/oniguruma -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/home/nite/source/php-5.2.0/TSRM -I/home/nite/source/php-5.2.0/Zend -I/home/nite/php5/include -g -O2 -c /home/nite/source/php-5.2.0/Zend/zend_default_classes.c -o Zend/zend_default_classes.lo
    /bin/sh /home/nite/source/php-5.2.0/libtool –silent –preserve-dup-deps –mode=compile gcc -IZend/ -I/home/nite/source/php-5.2.0/Zend/ -DPHP_ATOM_INC -I/home/nite/source/php-5.2.0/include -I/home/nite/source/php-5.2.0/main -I/home/nite/source/php-5.2.0 -I/home/nite/php5/include/libxml2 -I/home/nite/php5/include -I/home/nite/source/php-5.2.0/ext/date/lib -I/home/nite/php5/include/freetype2 -I/home/nite/source/php-5.2.0/ext/mbstring/oniguruma -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl -I/home/nite/source/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/home/nite/source/php-5.2.0/TSRM -I/home/nite/source/php-5.2.0/Zend -I/home/nite/php5/include -g -O2 -c /home/nite/source/php-5.2.0/Zend/zend_execute.c -o Zend/zend_execute.lo
    gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See for instructions.
    For Debian GNU/Linux specific bug reporting instructions,
    see
    .

    make: *** [Zend/zend_execute.lo] Error 1

    Posted by Anonymous | January 16, 2007, 03:52
  13. That looks like a permissions error. Do you have a htaccess file or settings that would interfere with the execution of code in the directories? Either that or you don’t have make installed.

    Posted by Hiveminds | January 16, 2007, 07:35
  14. I have it compiled and working on Fedora 5 and it is looking good. When I tried to copy it to the main cgi-bin it appeared to be missing some of the libraries.

    Now I don’t want the customised libraries to get mixed up with the server’s /usr/lib libraries. Is there a way of adjusting the php.ini or by some other means to get it to use some libraries from a specified location?

    Posted by Anonymous | January 22, 2007, 18:43
  15. There should not be a problem with this. The location of the extensions(I assume this is what you speaking of) is not a factor. They are not something that can be conflicting.

    The php.ini file should be located in the directory that you installed PHP in. The path looks something like this

    /php5/etc/php5/yourdomainname/php.ini

    Posted by Hiveminds | January 23, 2007, 14:43
  16. I kept getting errors until I copied the libraries to the servers main /usr/lib directory. I thought the webserver would automatically use the library paths that show up in phpinfo(). The php.ini automatically uses the compiled in location.

    It could be that I am getting libraries and extensions mixed up. The files I had to copy were files like libiconv, libxslt etc.

    one thing I was also considering is if the webserver needs read rights to the location in the users directory where the compilation was made.

    PS. I am using the process on my VPS, not at Dreamhost now.

    There should not be a problem with this. The location of the extensions(I assume this is what you speaking of) is not a factor. They are not something that can be conflicting.

    The php.ini file should be located in the directory that you installed PHP in. The path looks something like this

    /php5/etc/php5/yourdomainname/php.ini

    Posted by voipfc | January 23, 2007, 16:23
  17. VPS is nice. Thanks for reporting back on your experiments :)

    Later on I will be looking for is a VPS host that will run Java and does not cost a fortune.

    Posted by Anonymous | January 23, 2007, 17:12
  18. i installed the php,
    but when i look up info it still shows the default installation info

    what should be done
    i also have a dreamhost reseller

    please see myowncommunity.info/phpinfo.php

    Posted by Anonymous | February 20, 2007, 09:06
  19. You should add a htaccess file with code similar to this

    php_flag magic_quotes_gpc off

    # PHP 5, Apache 1 and 2
    Options +ExecCGI
    AddHandler fastcgi-script fcg fcgi fpl
    AddHandler php5-fastcgi .php
    Action php5-fastcgi /cgi-bin/php5.fcgi

    of course changing the code to point to the directory where you installed PHP.

    Posted by Anonymous | February 20, 2007, 12:38
  20. I am trying to install PHP5 for dreamhost to get eAccelerator. I already had php5 installed before from the wiki but need to reinstall it.

    After i removed the entire php5 folder i ran the script here and keep getting the following error:

    Installing PDO headers: /home/charity7/php5/include/php/ext/pdo/
    rm: cannot lstat `.’ in `.’: Stale NFS file handle

    Posted by Anonymous | March 29, 2007, 09:35
  21. make sure you have the compiler installed where it is available to the script

    Posted by Anonymous | March 29, 2007, 12:58
  22. what do you mean? the installscript is in the root of the ftp and i just let it run by itself. doesnt that automatically make it available to the script?

    Posted by Anonymous | March 31, 2007, 01:09
  23. I would not know. But the error you are getting is associated with it either not being installed on the server or not being available to the script. So you will have to check it out.

    Posted by Anonymous | March 31, 2007, 15:35
  24. I get the exact same error. Any ideas on how to track this down would be greatly appreciated.

    Installing PHP SAPI module: cgi
    Installing PHP CGI into: /home/******/php5/bin/
    Installing build environment: /home/******/php5/lib/php/build/
    Installing header files: /home/******/php5/include/php/
    Installing helper programs: /home/******/php5/bin/
    program: phpize
    program: php-config
    Installing man pages: /home/******/php5/man/man1/
    page: phpize.1
    page: php-config.1
    Installing PDO headers: /home/******/php5/include/php/ext/pdo/
    rm: cannot lstat `.’ in `.’: Stale NFS file handle

    Posted by Anonymous | April 27, 2007, 21:17
  25. How does one upgrade to a newer version after installing a custom PHP installation with Dreamhost?

    I currently have 5.2.0 but now 5.2.2 is out.

    Thanks for the help :)

    Posted by Anonymous | May 4, 2007, 06:20
  26. It’s pretty simple. Just change the version numbers for the PHP package and then run the script. Change the paths and file name if you do not want to overwrite the older cgi. I usually compile a newer package in a different directory, switch to it and if everything works I destroy the old PHP5 install.

    - Anders Hamilton

    Posted by Hiveminds | May 5, 2007, 11:45
  27. It appears that the configuration doesn’t work well with curl. Trying to use a curl commands results in a crash and I have noticed this after separate builds on separate machines. I will try once more to confirm this.

    The problem happens when I try to install SugarCRM

    Posted by voipfc | May 30, 2007, 17:37
  28. Many of the cms in the demo matrix use this setup and curl. Check the clever copy demo for a working example. http://demo.hiveminds.co.uk/clevercopy/

    Posted by Anonymous | May 31, 2007, 06:54
  29. I have a feeling that curl has some dependencies that are not accounted for in my setup which is a Centos VPS. Although the compilation succeeds curl may be linking the servers own libraries rather than those compiled with PHP I will check the dependencies to find out what it could be.

    I see that curl compiles –with-ssl=${INSTALLDIR} although no SSL library is compiled in the install dir. Could that be the problem?

    Posted by voipfc | June 6, 2007, 20:30
  30. Thanks for the script my dreamhost account is well on the way to supporting my egroupware application. Can you tell me how to get the fast cgi to use my custom install of pear instead of the dreamhost default?

    Mike

    Posted by Anonymous | July 11, 2007, 04:24
  31. You can install your own PEAR and point to it in your scripts. This is independant of PHP. Find out more here.

    http://wiki.dreamhost.com/index.php/PEAR

    Posted by Anonymous | July 11, 2007, 13:59
  32. i tried your coding which is great but i get a 403 error

    Forbidden

    You don’t have permission to access /cgi-bin/php5.fcgi/index.php on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    Posted by Anonymous | August 17, 2007, 07:35
  33. But for some reason in only works the domain of the original installation, I followed all of the instructions: the second shell script successfully creates a new folder in in php5 with the domain name as well as a cgi-bin (although it only has a php.cgi and not a php.fcgi) in the new domain. When I try a phpinfo the version of php is evidently the one on the server. What could be wrong?

    Posted by Anonymous | September 6, 2007, 03:49
  34. In the second script the line

    DOMAIN=”hiveminds.co.uk”

    should be

    export DOMAIN=”hiveminds.co.uk”

    Posted by Anonymous | September 6, 2007, 06:52
  35. the export domain didn’t solve the problem,:_(
    Is there any place where i could read more about how to solve a problem like this?
    its been months and i can’t use my domain. i’m super depressed over this.

    Posted by Anonymous | September 12, 2007, 06:57
  36. Hello,
    great script. Until now the best I have seen to solve the problem. I have the : Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in , which is quite common on the dreamhost with some program I have heard. Do you know if this will fix the problem? I am not sure how to include the call-time…. change. I you know, you help is appreciated. If anyone knows another way to solve the problem, please feel free to let me know. Thanks

    the domain is http://www.globalfirendsnet.com log-in
    you can email: eckhard-@-cnool.net (remove what is to much :-)

    Posted by Anonymous | September 21, 2007, 02:11
  37. You can set allow_call_time_pass_reference to true in your php.ini file

    Posted by Anonymous | September 21, 2007, 14:22
  38. This is good resource for Microsoft Interview Questions

    Posted by Anonymous | October 25, 2007, 08:19
  39. has there been any progress on this particular error? I just received it myself.

    My main goal here is to compile php 5.2.5 in order to get SOAP enabled.

    Posted by Anonymous | March 26, 2008, 15:26
  40. sorry, when I said “this particular error” I meant the one brought up by 2007-04-27 19:17 -

    rm: cannot lstat `.’ in `.’: Stale NFS file handle

    Posted by Anonymous | March 26, 2008, 15:29
  41. This error seems to only occur on Dreamhost servers and seems to happen only on a particular type of account (probably a permissions error). But those that get it still seem to get PHP5 compiled enough to work.

    Posted by Hiveminds | March 27, 2008, 16:22
  42. I have been trying to install php with this script priamriy to get soap enabled on DH. The script is not working and I am not sure why. It seems as if it is not writing the files and directories. This is a link to the output of my shell, well the last bit of it. If anyone has any ideas please let me know. oomoweb.com/phpscripterrors.txt. Thanks

    Posted by Anonymous | November 14, 2008, 01:26
  43. Many of your FTP sources are not available. Try doing a search in shell and changing the addresses to working ones in the script.

    Posted by Hiveminds | November 14, 2008, 07:06
  44. has anyone figured out a solution to rm: cannot lstat `.’ in `.’: Stale NFS file handle on Dreamhost?

    Posted by pdo pissed | April 23, 2009, 00:23

Post a comment

© 2003-2009 Hiveminds Magazine. Entries (RSS)
Powered by WordPress Theme by The Masterplan