install php 5.4.12 additional php version

Discussion in 'Installation/Configuration' started by dyveud, Oct 20, 2013.

  1. dyveud

    dyveud New Member

    hi all
    I just installed version php5.4.12 in fastcgi whith ispconfig 3. In additional php versions. After the installation site can not connect to mysql at this, the parameter of mysql connection are good. here's the address with the error message that appears: www.dyvteam.com .

    thank you all for your help

    sorry for my broken English because I'm French :p

    dyveud
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if mysql is not compiled into the php versions that you use. You can check that with phpinfo() command.
     
  3. dyveud

    dyveud New Member

    Thank you for your quick response.


    My PHP version I installed is 5.4.12. You can see my setup at this address (phpinfo () command): www.dyvteam.com/php.php

    Thank you in advance for your help!

    Dyveud
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The version that you compiled does not contain mysql, so you can not use mysql functions. Recompile it with mysql if you want to use the mysql functions in this php version.
     
  5. dyveud

    dyveud New Member

    Thank you for the answer,

    But how I grieve. I debuted on the debian machine. is there a tutorial?

    Thank you a thousand times :)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

  7. dyveud

    dyveud New Member

    With this tutorial I did install php 5.4.12 but I do not see what a place in the tutorial or there install mysql?!
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    see configure command:

    ....
    --with-mysql \
    --with-pdo-mysql \
    --with-mysqli \
    ....
     
  9. dyveud

    dyveud New Member

    THANK YOU VERY MUCH!

    But I have another problem, not site are not displayed correctly. I think there's a problem with the libxml. The site has already run on another server with a version of libxml2.7.7 out the version of ispconfig is libxml2.7.8. You think the error come from there?

    Here is the error code in the error.log:
    Code:
    [Mon Oct 21 14:16:29 2013] [warn] [client 10.0.2.2] mod_fcgid: stderr: PHP Fatal error:  Class 'RokCommon_Service_Definition' not found in /...***.../web/libraries/rokcommon/RokCommon/Service/Container/Loader/File/Xml.php on line 157
    
    here is the line 157 of file xml.php:

    Code:
    $definition = new RokCommon_Service_Definition((string) $service['class']);
    
    Here the complete xml.php file:

    Code:
    <?php
    
    /*
     * This file is part of the symfony framework.
     *
     * (c) Fabien Potencier <[email protected]>
     *
     * This source file is subject to the MIT license that is bundled
     * with this source code in the file LICENSE.
     */
    
    /**
     * RokCommon_Service_Container_Loader_File_Xml loads XML files service definitions.
     *
     * @package    symfony
     * @subpackage dependency_injection
     * @author     Fabien Potencier <[email protected]>
     * @version    SVN: $Id: Xml.php 10831 2013-05-29 19:32:17Z btowles $
     */
    class RokCommon_Service_Container_Loader_File_Xml extends RokCommon_Service_Container_Loader_File
    {
      /**
       * Loads an array of XML files.
       *
       * If multiple files are loaded, the services and parameters are merged.
       *
       * Remember that services and parameters are simple key/pair stores.
       *
       * When overriding a value, the old one is totally replaced, even if it is
       * a "complex" value (an array for instance):
       *
       * <pre>
       *   file1.xml
       *   <parameter key="complex" type="collection">
       *     <parameter>true</parameter>
       *     <parameter>false</parameter>
       *   </parameter>
       *
       *   file2.xml
       *   <parameter key="complex">foo</parameter>
       * </pre>
       *
       * If you load file1.xml and file2.xml in this order, the value of complex
       * will be "foo".
       *
       * @param  array $files An array of XML files
       *
       * @return array An array of definitions and parameters
       */
      public function doLoad($files)
      {
        return $this->parse($this->getFilesAsXml($files));
      }
    
      protected function parse(array $xmls)
      {
        $parameters = array();
        $definitions = array();
    
        foreach ($xmls as $file => $xml)
        {
          // create all the anonymous services and give them unique names
          list($anonymousDefinitions, $xml) = $this->processAnonymousServices($xml, $file);
          $definitions = array_merge($definitions, $anonymousDefinitions);
    
          // imports
          list($importedDefinitions, $importedParameters) = $this->parseImports($xml, $file);
          $definitions = array_merge($definitions, $importedDefinitions);
          $parameters = array_merge($parameters, $importedParameters);
    
          // parameters
          $parameters = array_merge($parameters, $this->parseParameters($xml, $file));
    
          // services
          $definitions = array_merge($definitions, $this->parseDefinitions($xml, $file));
        }
    
        return array($definitions, $parameters);
      }
    
      protected function parseParameters($xml, $file)
      {
        if (!$xml->parameters)
        {
          return array();
        }
    
        $parameters = $xml->parameters->getArgumentsAsPhp('parameter');
    
        // replace and %current.path% with the real current path
        $parameters = RokCommon_Utils_ArrayHelper::replaceTree('%current.path%', dirname($file), $parameters);
    
        return $parameters;
    
      }
    
      protected function parseImports($xml, $file)
      {
        if (!$xml->imports)
        {
          return array(array(), array());
        }
    
        $definitions = array();
        $parameters = array();
        foreach ($xml->imports->import as $import)
        {
          list($importedDefinitions, $importedParameters) = $this->parseImport($import, $file);
    
          $definitions = array_merge($definitions, $importedDefinitions);
          $parameters = array_merge($parameters, $importedParameters);
        }
    
        return array($definitions, $parameters);
      }
    
      protected function parseImport($import, $file)
      {
        if (isset($import['class']) && $import['class'] != get_class($this))
        {
          $class = (string) $import['class'];
          $loader = new $class($this->container, $this->paths);
        }
        else
        {
          $loader = $this;
        }
    
        $importedFile = $this->getAbsolutePath((string) $import['resource'], dirname($file));
    
        return call_user_func(array($loader, 'doLoad'), array($importedFile));
      }
    
      protected function parseDefinitions($xml, $file)
      {
        if (!$xml->services)
        {
          return array();
        }
    
        $definitions = array();
        foreach ($xml->services->service as $service)
        {
          $definitions[(string) $service['id']] = $this->parseDefinition($service, $file);
        }
    
        return $definitions;
      }
    
      protected function parseDefinition($service, $file)
      {
        if ((string) $service['alias'])
        {
          return (string) $service['alias'];
        }
    
        $definition = new RokCommon_Service_Definition((string) $service['class']);
    
        foreach (array('shared', 'constructor') as $key)
        {
          $method = 'set'.ucfirst($key);
          if (isset($service[$key]))
          {
            $definition->$method((string) $service->getAttributeAsPhp($key));
          }
        }
    
        if ($service->file)
        {
          $definition->setFile((string) $service->file);
        }
    
        $definition->setArguments($service->getArgumentsAsPhp('argument'));
    
        if (isset($service->configurator))
        {
          if (isset($service->configurator['function']))
          {
            $definition->setConfigurator((string) $service->configurator['function']);
          }
          else
          {
            if (isset($service->configurator['service']))
            {
              $class = new RokCommon_Service_Reference((string) $service->configurator['service']);
            }
            else
            {
              $class = (string) $service->configurator['class'];
            }
    
            $definition->setConfigurator(array($class, (string) $service->configurator['method']));
          }
        }
    
        foreach ($service->call as $call)
        {
          $definition->addMethodCall((string) $call['method'], $call->getArgumentsAsPhp('argument'));
        }
    
        return $definition;
      }
    
      protected function getFilesAsXml(array $files)
      {
        $xmls = array();
        foreach ($files as $file)
        {
          $path = $this->getAbsolutePath($file);
    
          if (!file_exists($path))
          {
            throw new InvalidArgumentException(sprintf('The service file "%s" does not exist.', $file));
          }
    
          $dom = new DOMDocument();
          libxml_use_internal_errors(true);
          if (!$dom->load($path))
          {
            throw new InvalidArgumentException(implode("\n", $this->getXmlErrors()));
          }
          libxml_use_internal_errors(false);
          //$this->validate($dom); // Commented out to get around libxml2 update issue
    
          $xmls[$path] = simplexml_import_dom($dom, 'RokCommon_Service_SimpleXMLElement');
        }
    
        return $xmls;
      }
    
      protected function processAnonymousServices($xml, $file)
      {
        $definitions = array();
        $count = 0;
    
        // find anonymous service definitions
        $xml->registerXPathNamespace('container', 'http://symfony-project.org/2.0/container');
        $nodes = $xml->xpath('//container:argument[boolean(@id)=false][@type="service"]');
    	$nodes ? $nodes : array();
        foreach ($nodes as $node)
        {
          $node['id'] = sprintf('_%s_%d', md5($file), ++$count);
    	  $same = false;
    	  foreach($definitions as $definition)
    	  {
    		  if ($definition[0] == ($node->service))
    		  {
    			  $same= true;
    			  break;
    		  }
    	  }
    	  if (!$same){
            $definitions[(string) $node['id']] = array($node->service, $file);
            $node->service['id'] = (string) $node['id'];
    	  }
        }
    
        // resolve definitions
        krsort($definitions);
        foreach ($definitions as $id => $def)
        {
          $definitions[$id] = $this->parseDefinition($def[0], $def[1]);
    
          $oNode = dom_import_simplexml($def[0]);
          $oNode->parentNode->removeChild($oNode);
        }
    
        return array($definitions, $xml);
      }
    
      protected function validate($dom)
      {
        libxml_use_internal_errors(true);
        if (!$dom->schemaValidate(dirname(__FILE__).'/services.xsd'))
        {
          throw new InvalidArgumentException(implode("\n", $this->getXmlErrors()));
        }
        libxml_use_internal_errors(false);
      }
    
      protected function getXmlErrors()
      {
        $errors = array();
        foreach (libxml_get_errors() as $error)
        {
          $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)',
            LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR',
            $error->code,
            trim($error->message),
            $error->file ? $error->file : 'n/a',
            $error->line,
            $error->column
          );
        }
    
        libxml_clear_errors();
    
        return $errors;
      }
    }
    
    
    Here are viewing the site: http://www.dyvteam.com

    here is my php configuration: http://www.dyvteam.com/php.php

    thank you enormously !!!!!!!!!!!!
     
  10. dyveud

    dyveud New Member

    don't have solution ?
     
  11. stefanm

    stefanm New Member HowtoForge Supporter

    Hi,
    are you sure that you are using your compiled 5.4 version? Looking at your phpinfo it says 5.3.xx at the top?!?
     
  12. dyveud

    dyveud New Member

    I have version 5.4.12 compile, I just tried another version compile PHP 5.3.22 I always block, in fact the site is a joomla 2.5 installation that I use for quite some time PHP 5.3.5 in a wamp server without problem. So I set up a factory in ispconfig on ubuntu server. I therefore this site not work (dyvteam.com), so I try to make another site (perouetnous.fr) with an installation of joomla on the same installation ispconfig and no problem ...

    Please help me, dyvteam.com is a community of French gamer and we are in big trouble.

    Thank you in advance for your help

    dyveud
     
  13. stefanm

    stefanm New Member HowtoForge Supporter

    Do you perhaps need to adjust the php include path of your site, so it can find the rokcommon classes?

    BTW, the page that comes up when calling your domain looks like unparsed php and it does NOT start with a "<". Might be a subsequent behaviour of a different problem, but just in case... perhaps you want to check that there wasn't accidentially deleted a leading "<" in the file?
     
  14. dyveud

    dyveud New Member

    No I did not delete <on the old server that work very well, I did make any changes after the transferred on ispconfig
     
  15. dyveud

    dyveud New Member

    I can probably find the solution to my problem, I would tell you if my problem is solved or not.
     
  16. dyveud

    dyveud New Member

    :):) YEPPPPPPPPPPP!!

    The problem is solved, in fact when I transfered the site via ftp, full file were wrong. So I'm in a zip file on the old server and then I transfer the zip on the new server then I extract it and change the right files. And here the site is back: www.dyvteam.com.

    Thank you all for your response and your patient.

    Thank you so much!!

    Dyveud

    Come for a ride: www.dyvteam.com and tell me what you think ... :):)
     

Share This Page