+ Reply to Thread
Results 1 to 10 of 10

Thread: Trying to set up i5 with Framework

  1. #1
    chris_hird is offline Junior Member
    Join Date
    Feb 2007
    Posts
    15

    Default Trying to set up i5 with Framework

    Hi

    I am trying to set up the Framework on a System i5 and have a lot of problems?

    Here is my directory structure
    /www
    /website
    /Application
    /controllers
    /views
    /models
    /htdocs
    /images
    /scripts
    /styles
    /library
    /Zend
    /tmp

    I am trying to run a sample project which is described on the IBM site but is using windows as the server.

    First problem is being able to set the root directories correctly
    when setting the controller directory I have to put the full path in which is /www/website/Application/controllers. I have to do that for all the directory paths as far as I can tell? When setting up the indexView I also have to set the path as /www/website/Application/views. What I would like to do is be able to set the base directory and build up from that? The index.php is sitting in /www/website/htdocs so I tried reference the controllers using ../Application/controllers and it doesnt work? I have also set the paths /www/website/library and /www/website/application in the php.ini file hoping this would allow the refrencing to work but it doesnt?

    The next problem was being able to set up the connection to the DB2 database. I get no feedback into the debugger to point me to the problems so I hope someone can help me from here?

    Chris...

  2. #2
    SpotSec's Avatar
    SpotSec is offline Senior Member
    Join Date
    Feb 2007
    Location
    United States
    Posts
    122

    Default

    Hi Chris,

    Can you post your configuration files? It will help us determine what is wrong with the setup.

    SpotSec
    Zym Framework - A Zend Framework extension library w/ demo app

    SpotSec Blog:
    http://spotsec.com/blog

  3. #3
    chris_hird is offline Junior Member
    Join Date
    Feb 2007
    Posts
    15

    Default

    I am going to rebuild the HTTP server first as I have noticed a couple of strange problems. Once I have cleared these up I will post the configs

    Thanks

  4. #4
    chris_hird is offline Junior Member
    Join Date
    Feb 2007
    Posts
    15

    Default i5 Configs

    These are what works but I think I can cut out some of the config. I am having problems with zendcore and server status which I have logged with support.
    Attached Files

  5. #5
    SpotSec's Avatar
    SpotSec is offline Senior Member
    Join Date
    Feb 2007
    Location
    United States
    Posts
    122

    Default

    everything looks in working order here, but I actually was talking about posting your sections where your have set include paths, controller configs, etc..

    What I have done before is setting/determining a global base directory and dynamically setting include paths
    Zym Framework - A Zend Framework extension library w/ demo app

    SpotSec Blog:
    http://spotsec.com/blog

  6. #6
    chris_hird is offline Junior Member
    Join Date
    Feb 2007
    Posts
    15

    Default Setup for directories

    I have the following set up for the directories

    Directory ->Application
    contains folders config, controllers,views,models
    Directory ->htdocs
    contains folders images, scripts, styles
    Directory ->library
    contains folder Zend (this is the Framework)
    Directory tmp
    Contains folders cache, sessions, view_compiles

    The server is set to serve pages from htdocs. I did not want to have the Application in the htdocs directory so this seemed like a reasonable structure?

    I have the UserController.php in the Application/controllers directory and here is a piece of code where I am having to define the whole path to the view
    Code:
    function registerAction()
    	{
    		$view = new Zend_View();
    		$view->setScriptPath('/www/shieldcrm/application/views');
    		echo $view->render('register.php');
    	}
    This is the same for all of the script paths I have to set. In a tutorial I am reviewing the path is set simply as 'controllers' or 'views' so I can only assume that somewhere there is a basedir value I can set which would state that all requests for these files use the base plus the next level?

    Chris...

  7. #7
    chris_hird is offline Junior Member
    Join Date
    Feb 2007
    Posts
    15

    Default

    I have set up the php.ini to see the /www/shieldcrm/application in searches. This allows me to include files in the config simply by using config/DB_config.php etc... However I still have to set the scriptpaths etc to the full path ie /www/shieldcrm/application/controllers etc...

    How can I set the scriptpaths to be linked to a partial url?

    Chris...

  8. #8
    DaveA is offline Junior Member
    Join Date
    Apr 2007
    Posts
    1

    Default

    We too are contemplating using Zend Framework on an i5 to access a DB2 database on the i5.

    Is this what you are trying to do, and have you had any luck doing it?

    My consultant is perplexed because Framework apparently uses "PDO_ODBC" to connect to databases, and according to the IBM RedBook, "PHP: Zend for i5/OS" "PDO_ODBC" is not currently supported with DB2 for i5/OS.

    Have you found any workarounds for this?

    Thanks, Dave

  9. #9
    SpotSec's Avatar
    SpotSec is offline Senior Member
    Join Date
    Feb 2007
    Location
    United States
    Posts
    122

    Default

    Quote Originally Posted by chris_hird View Post
    I have set up the php.ini to see the /www/shieldcrm/application in searches. This allows me to include files in the config simply by using config/DB_config.php etc... However I still have to set the scriptpaths etc to the full path ie /www/shieldcrm/application/controllers etc...

    How can I set the scriptpaths to be linked to a partial url?

    Chris...
    Actually now Zend_View will automatically render views from the views folder in a setup described here: Ben Ramsey » Blog Archive » Zend Framework View Notes

    As for setScriptPath(), a relative path I think would start from your controllers directory (so '../views'). You can use get_include_path() as a lazy way for the path of the views or do something similar to this:

    [php]
    $appDir = Zend_Registry::getInstance()->get('applicationDirectory');
    $this->setScriptPath($appDir . DIRECTORY_SEPARATOR . $request->getModuleName() . '/Views');
    [/php]
    Last edited by SpotSec; 05-02-2007 at 11:14 PM.
    Zym Framework - A Zend Framework extension library w/ demo app

    SpotSec Blog:
    http://spotsec.com/blog

  10. #10
    davelhs03 is offline Junior Member
    Join Date
    Mar 2009
    Posts
    4

    Default

    I was wondering if you guys know of any work arounds for connecting to the i5/AS400 using PDO_IBM, PDO_ODBC or db2, without purchasing db2 connect. I want to use zend's adapters, but it appears i need a license for that. ODBC Data Source Administrator shows that i have iSeries Access ODBC driver, so i think i might try to use that, but not sure how to tell PDO_ODBC to use that driver.

    The client machine is running

    Windows XP 64 bit
    XAMPP 1.7.0 - so i can run PHP files locally
    Zend Framework 1.7.6 - Zend DB classes

    More Info on my problem: Why can't DB2 access be simple? - Zend Core for IBM - PHP support & tips - Zend.com

    Thanks for any help

+ Reply to Thread

Posting Permissions

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