Ispconfig 3 ZendFramework

Discussion in 'Installation/Configuration' started by Brian_A, May 22, 2011.

  1. Brian_A

    Brian_A New Member

    Hi
    I have installed the latest version of the ZendFramework, but cannot see where I need to set the php include path.
    I've set:-
    ln -s release-1.11.6 current

    include_path = ".:/opt/ZendFramework/current/library:/usr/share/php5:/usr/share/pear"

    in:-

    /etc/php5/apache2/php.ini

    but this does not seem to be correct as I still receive file not found errors for the Zend php files

    Brian A
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Did you restart Apache?
     
  3. Brian_A

    Brian_A New Member

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Which php type have you set in the website settings in ispconfig for thsi website? Did you add any custom php.ini settings in that website?
     
  5. Brian_A

    Brian_A New Member

    In ISPConfig the php settings for this site are Fast-CGI.

    The adddress is www.thissite.com/BookPdf.php
    There are no custom php.ini settings in this site i.e we are not using set_include_path() or anything else.

    Here is index.php for this folder
    <?php

    include_once("BookPdf.php");
    include './Templates/BookConfig.php';
    include './Templates/BookTemplate.php';

    $pdf = new BookPdf();
    $pdf->PrintBook($bookTemplatePort, $book, 4);

    ?>

    and here is the header of the BookPdf class

    require_once('Zend/Pdf.php');

    class BookPdf {
    //*****//
    }

    When we run this web address
    we get
    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Pdf.php' (include_path='/opt/ZendFramework/current/library/') in /var/www/clients/client1/web1/web/BookPdf/BookPdf.php on line 15

    So I'm lost at the moment

    Brian A
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess you edited the wrong php.ini file. The file /etc/php5/apache2/php.ini is for mod_php only. I you want to set a value for cgi or fastcgi, you have to edit the file /etc/php5/cgi/php.ini
     
  7. Brian_A

    Brian_A New Member

    Ok I edited that file too without any change, so set the php call to the full path like this

    require_once('/opt/ZendFrameWork/current/library/Zend/Pdf.php');

    Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/opt/ZendFrameWork/current/library/Zend/Pdf.php) is not within the allowed path(s): (/var/www/clients/client1/web1) in /var/www/clients/client1/web1/web/BookPdf/BookPdf.php on line 15

    So does this mean I should set some permissions in some place?

    Brian
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    First, make sure that you resatrted the apache webserver after the changes. Then add your installation path /opt/ZendFrameWork/current/library/ at the end of the open_baesir paths separated by a : in the website settings and wait a minute until your system is reconfigured.
     
  9. Brian_A

    Brian_A New Member

    I'm sure each time to restart apache, but I'm not sure when you say 'at the end of the open_baesir' where to find this? I don't find it the php.ini or in the ISPConfig panel.

    Can you tell me where to find it.

    Brian A
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    See website settings in ISPconfig, there is only one field with the name open_baesdir on the options tab.
     
  11. Brian_A

    Brian_A New Member

    In IPSConfig 3.0.1.4

    in Sites tab

    Selecting this site in Options tab I have:-

    Web Domain

    * Domain * Redirect * SSL * Stats * Options

    Linux User web1
    Linux Group client1
    Apache directives

    Is this where you mean?

    Brian
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    You use a very old ISPConfig version. Please update ispconfig to the recent version (3.0.3.3).
     
  13. Brian_A

    Brian_A New Member

    OK that seems to do trick with the latest ispconfig I can get to the Zend library. Thank you for your advice. Now I have an extra problem that I don't get on my dev server:

    Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 642616 bytes) in /opt/ZendFrameWork/release-1.11.6/library/Zend/Pdf/Parser.php on line 379


    I guess I should be more clear, sorry. What I mean is; do I need to do something with ISPConfig or is better to set "memory_limit" = 32; in the php.ini or use ini_set("memory_limit","32M") in the script;

    Brian
     
    Last edited: May 24, 2011
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    You need to set a higher memory limit in the php.ini file.
     
  15. Brian_A

    Brian_A New Member

    Install ZendFramework on Ubuntu with ISPConfig 3

    We needed to install the latest version of the ZendFramework on our existing Ubuntu 10.1 server that already had ISPConfig 3 installed. With a lot of help from other posts and forums on this site http://www.howtoforge.com/basic-web-server-on-ubuntu-9.04-with-zend-framework and especially help from till and falko, this is what we needed to do.

    1. We needed to upgrade our ISPConfig from 3.0.1.4 to 3.0.3.3. We followed the guide here to do that. http://www.faqforge.com/linux/controlpanels/ispconfig3/how-to-update-ispconfig-3/

    2. Installing the ZendFramework we followed these parts of this howto, http://www.howtoforge.com/basic-web-server-on-ubuntu-9.04-with-zend-framework. I'll repeat the steps we used from this.

    vim /etc/apache2/sites-available/default
    [...]
    DocumentRoot /var/www
    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    [...]

    cd /opt
    mkdir ZendFramework
    cd /ZendFramework
    svn co http://framework.zend.com/svn/framework/standard/tags/release-1.11.6/

    ln -s release-1.11.6 current

    vim /etc/php5/apache2/php.ini

    add include path
    include_path = ".:/opt/ZendFramework/current/library:/usr/share/php5:/usr/share/pear"

    and to allow for Fast-CGI

    vim /etc/php5/cgi/php.ini

    add include path

    include_path = ".:/opt/ZendFramework/current/library:/usr/share/php5:/usr/share/pear"

    We found that the memory_limit was set to 16M which is too small for some Zend file and image operations so we set it to
    memory_limit = 32M

    restart apache

    /etc/init.d/apache2 restart

    for the command line just in case we need it later

    vim /etc/php5/cli/php.ini
    include_path = ".:/opt/ZendFramework/current/library:/usr/share/php5:/usr/share/pear"

    get out of super user
    exit

    vim ~/.bashrc
    [...]
    PATH=/opt/ZendFramework/current/bin:"${PATH}"
    [...]

    sudo reboot

    When you log back in don't sudo su but instead:
    zf.sh show version

    should show this
    Zend Framework Version: 1.11.6

    3. Finally some additions to options for the sites in ISPConfig
    In Sites - for each site to update
    In Options - PHP open_basedir
    add :/opt/ZendFramework/current/library:/usr/share/php5:/usr/share/pear
    to the end of the string

    Close ISPConfig panel and restart apache just for luck.

    Well this worked for us, thanks to the good advice we got from this forum

    Brian
     

Share This Page