PHP install error

Discussion in 'Bug Reports' started by raphidae, Jan 13, 2010.

  1. raphidae

    raphidae Member

    For some reason PHP always fails to install. I have never seen Litespeed install PHP correctly since I started using it more than a year ago. The error is always the same:

    Code:
    Build complete.
    Don't forget to run 'make test'.
    
    Installing PHP
    Installing PHP SAPI module:       litespeed
    :No such file or directory
    Installing build environment:     /usr/local/lsws/lsphp5/lib/php/build/
    Installing header files:          /usr/local/lsws/lsphp5/include/php/
    Installing helper programs:       /usr/local/lsws/lsphp5/bin/
      program: phpize
      program: php-config
    Installing man pages:             /usr/local/lsws/lsphp5/man/man1/
      page: phpize.1
      page: php-config.1
    1 error
    *** Error code 1 (continuing)
    `install' not remade because of errors.
    **ERROR** Could not install PHP
    
    As the compile did complete successfully I've always simply fixed this by doing something like:

    'cp /usr/local/lsws/phpbuild/php-5.3.1/sapi/litespeed/php /usr/local/lsws/fcgi-bin/lsphp5'

    As I use FreeBSD exclusively this might be a FreeBSD specific bug, I have noticed it on 6-RELEASE, 6-STABLE, 7-STABLE, 8-RC1, 8-STABLE and 9-CURRENT.

    I'm guessing the compiler writes the lsapi php binary somewhere else on FreeBSD or something similar.
  2. raphidae

    raphidae Member

    This is still present in 4.0.13...
  3. raphidae

    raphidae Member

    I've investigated:

    Code:
    [root@virasena /opt/lsws]# /usr/local/lsws/phpbuild/buildphp_manual_run.sh
    Manually running installation script: /usr/local/lsws/phpbuild/buildphp_1270060006.9.install.sh
    Running at background with command:
    /usr/local/lsws/phpbuild/buildphp_1270060006.9.install.sh 1> /usr/local/lsws/phpbuild/buildphp_1270060006.9.log 2>&1
    [: xroot: unexpected operator
    
    First, this doesn't run in the background as stated.

    Second, there's an error due to:

    Code:
    if [  "x$INST_USER" == "xroot" ]; then
       chown -R lsadm:lsadm /usr/local/lsws/phpbuild/php-5.2.12
       check_errs $? "Could not chown to lsadm for direcotry /usr/local/lsws/phpbuild/php-5.2.12"
    fi
    
    in buildphp_xx.9.install.sh & buildphp_manual_run.sh

    '==' is not a valid operator for a test evaluation. At least it isn't on BSD. You should be using '=' there.

    The actual install error is due to the following:

    Code:
    [root@virasena /opt/lsws/phpbuild/php-5.2.12]# make -k install-sapi
    Installing PHP SAPI module:       litespeed
    :No such file or directory
    *** Error code 1 (continuing)
    
    [root@virasena /opt/lsws/phpbuild/php-5.2.12]# make -k -n install-sapi
    echo "Installing PHP SAPI module:       litespeed"
    /usr/local/lsws/phpbuild/php-5.2.12/build/shtool mkdir -p /opt/lsws/lsphp5/bin
    if test ! -r /usr/local/lsws/phpbuild/php-5.2.12/libs/libphp5.so; then  for i in 0.0.0 0.0 0; do  if test -r /usr/local/lsws/phpbuild/php-5.2.12/libs/libphp5.so.$i; then  ln -s /usr/local/lsws/phpbuild/php-5.2.12/libs/libphp5.so.$i /usr/local/lsws/phpbuild/php-5.2.12/libs/libphp5.so;  break;  fi;  done;  fi
    
    [root@virasena /opt/lsws/phpbuild/php-5.2.12]#
    
    Notice the blank line after the two commands. Somehow make is trying to execute an empty command... This is due to this in '/usr/local/lsws/phpbuild/php-5.2.12/Makefile':

    Code:
    install-sapi: $(OVERALL_TARGET)   
            @echo "Installing PHP SAPI module:       $(PHP_SAPI)"
            -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
            -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
                    for i in 0.0.0 0.0 0; do \
                            if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
                                    $(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \
                                    break; \
                            fi; \
                    done; \
            fi
            @$(INSTALL_IT)
    
    The variable INSTALL_IT should have been set in '/usr/local/lsws/phpbuild/php-5.2.12/sapi/litespeed/config.m4', even if not used, otherwise it results in trying to execute "". Adding

    INSTALL_IT="@true"

    to '/usr/local/lsws/phpbuild/php-5.2.12/sapi/litespeed/config.m4' will fix this.

    I'm quite concerned that apparently you haven't fully tested at least the last three releases on BSD and that a small error like this isn't fixed in over two months. If you aren't taking the BSD platform seriously I'd like to know.

    (Also, there's two spelling/grammar errors in this: 'Running at background with command:' -> 'Running command in the background:' and 'direcotry' -> 'directory'.)
    Last edited: Apr 1, 2010
  4. raphidae

    raphidae Member

    Since litespeed SAPI is included in PHP >5.3 distributions I reported this bug to PHP, see: http://bugs.php.net/bug.php?id=51452

    As I noticed that 'php-litespeed-5.3.tgz' is downloaded anyway and extracted over 'sapi/litespeed', I urge you to fix this as well.

Share This Page