Results 1 to 8 of 8
  1. #1

    Question Reconfigure PHP5 on cPanel Server

    I have PHP 5.2.0 installed on my cPanel dedicated server (by using the apache update under WHM)

    I am now trying to use the XSL Functions in PHP5 (http colon slash slash au2.php.net/manual/en/ref.xsl.php), but I get an error -
    Fatal error: Class 'XSLTProcessor' not found in /home/username/public_html/scriptname.php on line 6
    According to the PHP documentation, I just need to add "--with-xsl" to the configure line.

    This doesn't seem to be possible using "apache update" under WHM, so I'm trying to do it from the commandline, but cannot seem to get it to work. Here is what I am doing, can anyone tell me what I'm doing wrong?
    1. I got the configure command from phpinfo() -

      './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-xmlrpc' '--with-zip' '--with-zlib'
    2. I removed the quotes from the configure command, removed --with-apxs and added --with-xsl, then went to /home/cpapachebuild/buildapache/php-5.2.0 and ran it -

      ./configure --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --with-curl --with-dom --with-dom-xslt --with-dom-exslt --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-iconv --with-imap=/usr/local/imap-2004g --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --with-mcrypt --enable-magic-quotes --with-mysqli --with-mysql=/usr --with-openssl --enable-discard-path --with-pear --enable-xslt --with-xslt-sablot --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --with-xmlrpc --with-zip --with-zlib --with-xsl
    3. Then executed the following

      make
      make install
      http restart
    After doing this, when I go back to my phpinfo(), it still looks the same as before, and my xsl script still does not work...

    I know I am missing something basic, but I just can't seem to find it, and I've been searching for hours! Any help would be greatly appreciated.

  2. #2
    Join Date
    Apr 2002
    Location
    Auckland - New Zealand
    Posts
    1,575
    You need the following, as per http://us2.php.net/manual/en/ref.xsl.php

    --with-xsl[=DIR]

    So, check you have the required development libraries (assuming centos/redhat)

    # yum install libxslt-devel

    and compile php with

    --with-xsl=/usr

  3. #3
    Thanks for your reply Dotable Steve!
    (quote=Dotable Steve)You need the following, as per http colon slash slash us2.php.net/manual/en/ref.xsl.php

    --with-xsl[=DIR](/quote)
    Agreed, I definitely need --with-xsl....
    (QUOTE=Dotable Steve)# yum install libxslt-devel(/quote)
    Hmmm, this doesn't sound right. From the way I had read the article, php5 includes xsl, it just needs to be "configured" to get it going... It sounds to me like you shouldn't need to install anything outside of php5...
    (quote=Dotable Steve)and compile php with

    --with-xsl=/usr(/quote)
    This is the part of the process that I needed to be explained further....

    In the meanwhile, I have found a solution for this. I'll put it here for any cPanel users who need this (and for my own future reference!)
    1. Edit /home/cpapachebuild/buildapache/buildscript
    2. There are about a dozen lines that start with ./configure and have all of the php options as listed in my original post. add --with-xsl to the end of all of them.
    3. Execute this -

      sh /home/cpapachebuild/buildapache/buildscript

  4. #4
    More simple path to make this:

    CUSTOM_PHP_FLAGS="--with-xsl" /scripts/easyapache

    Advanced users can use
    FULL_CUSTOM_PHP_FLAGS="'--with-xsl' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--enable-memory-limit' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pgsql=/usr' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-wddx' '--with-xmlrpc' '--with-zlib'" /scripts/easyapache

  5. #5
    Join Date
    Jan 2002
    Posts
    362
    Quote Originally Posted by cobain View Post
    More simple path to make this:

    CUSTOM_PHP_FLAGS="--with-xsl" /scripts/easyapache

    Advanced users can use
    FULL_CUSTOM_PHP_FLAGS="'--with-xsl' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--enable-memory-limit' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pgsql=/usr' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-wddx' '--with-xmlrpc' '--with-zlib'" /scripts/easyapache
    Can somebody confirm for me the operation of "CUSTOM_PHP_FLAGS" and "FULL_CUSTOM_PHP_FLAGS" within the cPanel environment?

    Am I correct in assuming that if I specify --with-xsl via CUSTOM_PHP_FLAGS, will this simply add that flag to anything I choose in easyapache, where FULL_CUSTOM_PHP_FLAGS will override ALL php flags chosen in easyapache?

  6. #6
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    14,135
    Truth be told, it's simpler just to create a bash script to update apache, then download php (from the official site), recompile it with the options YOU want and then go from there.
    Tom Whiting, WHMCS Guru extraordinaire
    Linux problems? WHMCS Problems? Give me a shout
    Check out my WHMCS Addons

  7. #7
    Join Date
    Aug 2006
    Location
    India
    Posts
    86
    Quote Originally Posted by aha1 View Post

    In the meanwhile, I have found a solution for this. I'll put it here for any cPanel users who need this (and for my own future reference!)
    1. Edit /home/cpapachebuild/buildapache/buildscript
    2. There are about a dozen lines that start with ./configure and have all of the php options as listed in my original post. add --with-xsl to the end of all of them.
    3. Execute this -

      sh /home/cpapachebuild/buildapache/buildscript


    yaa this is the best way to configure XSL with the PHP. I did this many times without an error. Once the build will complete check the PHP modules by using the command

    PHP Code:
    php -
    Abee

    It is easier to write an incorrect program than understand a correct one.

  8. #8
    Join Date
    Jan 2002
    Posts
    362
    Quote Originally Posted by Abee View Post
    yaa this is the best way to configure XSL with the PHP. I did this many times without an error. Once the build will complete check the PHP modules by using the command
    Running easyapache with CUSTOM_PHP_FLAGS from shell seems a bit easier and more reliable than modifying buildscript etc. Just run:

    CUSTOM_PHP_FLAGS="--with-xsl" /scripts/easyapache

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •