Results 1 to 15 of 15
  1. #1
    Join Date
    Aug 2009
    Posts
    239

    Lightbulb Install Zend Framework under Linux Cpanel shared account.

    PHP frameworks have multiple benefits in web development as rapidly web application development,
    user-friendly URL namespaces, classes and methods.

    Based on Model-View-Controller (MVC) paradigm and supplied with a new command line tool,
    Zend Framework is gaining popularity in PHP object-oriented web applications development.

    Here is simple tutorial to install and configure the Zend framework under Linux Cpanel shared account.

    system requirement

    # PHP 5.2.4 or later version and apache mod_rewrite module.
    # SUEXEC enabled server ( To affect account level PHP enviournment in php.ini file )
    # Jailshell access.
    Configuration

    # Get Zend Framework from zend.com/community/downloads Zend Community Downloads - Zend.com and extract the contents to your local disk.

    # Extract ZendFramework-XX.tar.gz and rename 'ZendFramework-x.x.x' folder to Zend

    # Upload 'Zend' folder under Document root : Eg. /home/cpusername/public_html/
    Please make sure FTP transfers the files in binary mode (BIN).

    # Display the PHP information. Create a file 'info.php' with the following line in it:
    <?php phpinfo(); ?>

    # Visit your site or preview site and open info.php - make a note of the "DOCUMENT_ROOT" value, and the "include_path" value.

    # create php.ini file under same folder and add your zend library path in include path , enable allow_url_fopen and allow_url_include functions:

    include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/cpusername/public_html/Zend/library"
    allow_url_fopen = On
    allow_url_include = On

    # open .htaccess file and put following line :

    SetEnv PHPRC /home/cpusername/public_html/php.ini

    # create zend-test.php file and put following code :

    <?
    require_once 'Zend/Mail.php';
    $mail=new Zend_Mail();
    echo 'it is working';
    ?>

    # Access domain.com/zend-test.php
    It will show "it is working" message if everything goes fine

    Now let's create one test application using ZF Command Line tool (CLI) which is supplied with Zend Framework

    You can get detail ZF CLI usage information here : framework.zend.com/manual/en/zend.tool.usage.cli.html

    Set aliase for Zend/bin/zf.sh binary with following command :

    $ alias zf='/home/cpusername/public_html/Zend/bin/zf.sh'

    $ chmod 755 /home/cpusername/public_html/Zend/bin/zf.shzf.sh

    $ zf show version

    $ zf --help

    cd /home/cpusername/public_html/

    $ zf create project my-zf-test

    It will say : Creating project at /home/cpusername/public_html/Zend/my-zf-test
    Note: This command created a web project, for more information setting up your VHOST, please see docs/README
    Done !

    Access : domain.com/my-zf-test/public/


    # Contact to support to update the domain document root directly to the public directory where your ZF application resides :

    Eg. /home/cpusername/public_html/my-zf-test/public

    Now just set appropriate redirect rules under .htaccess file.

    For more information please refer ZF manual here : framework.zend.com/manual

  2. #2
    Join Date
    Oct 2008
    Posts
    123

    Default

    Thanks for sharing this with us Kieran

  3. #3

    Default Close but no cigar...

    First I want to apologize if I ask any stupid questions or doing something wrong. I'm trying to install the Zend Framework on a shared server and on a subdomain: zf.locatestyle.com. I've followed your instructions with one slight deviation, tried making the php.ini but received an error saying the file couldn't be found when I did the zend-test.php. Instead I used PHP's set_include_path. Got the zend-test.php working but I'm completely lost on the second part. I very new to Zend and not familiar with it at all. Where exaclty do I go for the ZF Command Line tool (CLI). I read the link you provided but still lost. Is this a page on my site I go to and then type the commands in or somewhere in cPanel? Any help would be greatly appreciated.

  4. #4

    Default

    True, this will get the framework installed and a project all set up.

    Just remember that you need to protect the framework app files from web access, especially the files in the application/config folder.

    Just add an .htaccess file to each of the ZF folders containing a "Deny from All" statement.

    Complete details of an approach that is similar to this can be found on my blog (eukhost system won't allow me to post the url until I have five posts).

    Cheers!

  5. #5
    Join Date
    Aug 2009
    Posts
    239

    Thumbs up

    Quote Originally Posted by bmarshall View Post
    Got the zend-test.php working but I'm completely lost on the second part. I very new to Zend and not familiar with it at all. Where exaclty do I go for the ZF Command Line tool (CLI). I read the link you provided but still lost. Is this a page on my site I go to and then type the commands in or somewhere in cPanel? Any help would be greatly appreciated.
    In order to use ZF Command Line tool (CLI), you should have SSH access which will allow you to set aliase for zf.sh binary and create application structure . As EUKHOST provides jail shell access for Cpanel accounts on few shared server so it is possible to install Zend Framework and create applications using ZF Commands on shared Cpanel server.

    You will have to ask to your hosting provider to grant jailshell access, so once you get SSH access then just follow above steps.

    Please refer following links to get more information on Zend framework implementation :

    Zend Framework: Using Zend_Tool On The Command Line
    Zend Framework: Documentation



    Regards,
    Kieran A
    Last edited by Kieran; 15-05-2010 at 20:40.

  6. #6

    Default ZF TOOL - Not working help Kieran

    Hi Kieran,

    First of all thanks for posting this article on the web. Out of millions of help files on the zend framwork, I stopped on yours and decided to attempt on it.

    I am a developer and I am working on a project where I have asked to develop a website in the zend framwork. So , I attempted your steps but got stuck in the SSH server access bit, where I use ZF tool to create projects. I do have an access to SSH on my hosting account but something is going wrong and I don't know what.

    For you to correctly pinpoint the mistake, I have prepared a jpg file with my screenshots inside it. It has the same paths and location of each files.

    Please see the attachment with this message.

    Your help would be much appreciated.

    Regards
    Kannu
    Attached Images Attached Images

  7. #7
    Join Date
    Aug 2009
    Posts
    239

    Thumbs up

    Quote Originally Posted by kannu80 View Post
    Hi Kieran,

    First of all thanks for posting this article on the web. Out of millions of help files on the zend framwork, I stopped on yours and decided to attempt on it.

    I am a developer and I am working on a project where I have asked to develop a website in the zend framwork. So , I attempted your steps but got stuck in the SSH server access bit, where I use ZF tool to create projects. I do have an access to SSH on my hosting account but something is going wrong and I don't know what.

    For you to correctly pinpoint the mistake, I have prepared a jpg file with my screenshots inside it. It has the same paths and location of each files.

    Please see the attachment with this message.

    Your help would be much appreciated.

    Regards
    Kannu

    You're most welcome Kannu

    I could have helped you more if your account had hosted on our server.

    As per attached screenshot, you have put correct include path for zend library so
    script is able to refer library files. But there must be something wrong while setting aliase path. and you wont be able to use ZF Commands until zf aliase is set for zf.sh binary.
    you will have to contact to your hosting support and check further issue.

    Thank you.

    Regards,
    Kieran A.

  8. #8

    Default ZF tool - Parse error - Thanks

    Hi Kieran,

    First of all thanks for the message. As you suggested to look at the way the alias is being defined and if the correct path is being used. I attempted many ways of setting up the alias and now I am having this error which is atleast something useful than the previous one.

    This is where my problem is happening. I am trying to create an alias and when I do zf version this problem comes up. please see the bold error message

    [site.com@web103 ~]$ alias zf='. /public_html/Zend/bin/zf.sh'
    [site.com@web103 ~]$ which zf
    alias zf='. /public_html/Zend/bin/zf.sh'
    [site.com@web103 ~]$ chmod 755 /home/sites/site.com/public_html/Zend/bin/zf.sh
    [site.com@web103 ~]$ zf show version
    <br />
    <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/home/sites/site.com/public_html/Zend/bin/zf.php</b> on line <b>38</b><br />


    Your help would be much appreciated.

    Regards
    Kannu

  9. #9

    Default Zend framework - Kieran

    Hi Kieran,

    I have spent many no of hours in trying to get this thing working but
    something has come into my mind and I just wanted to clarify with you. As you
    have mastered this sought of area, you will be able to clarify me easily.

    First of all I think I was wrong about installing zend framework on my hosting environment.

    Why is there any need of installing framework on the hosting environment?

    If you could easily do on a local server on the computer and than upload the files developed in zend framework to the hosting server for the public to see.

    This came into my attention when I started my Zend IDE and I decided to look for clues in that
    and than I found a link to creat folders tab with few other things. So, my point is I create my framework project on my pc (i know it sounds bit stupid for a programmer to ask) than upload my framework project to my hosting space. Than all I have to do is point my server php -cgi module to point at my required location.

    Sorry, I have to ask you as the creators of zend decided to put their framework on the market without even thinking of creating a resonable documentation for the general public.

    Please do guide me on this.

    Regards
    Kannu

  10. #10
    Join Date
    Aug 2009
    Posts
    239

    Thumbs up

    Hi Kannu,

    I have installed and configured Zend Framework under Linux Cpanel shared account ( All system requirement are fulfilled ) and it has been working fine without any problem.

    I'm not sure with exact reason as your account is not hosted on our server but please make sure that your server support required PHP version. It seems that you have also posted this issue on Zend's forum so I hope you will get the solution from another developer if any.

    Quote Originally Posted by kannu80 View Post
    Why is there any need of installing framework on the hosting environment?
    Most of the server has default PEAR as PHP Framework but Zend framework has some advanced features, and if your project need ZF then you can install and use it.
    Even though we do not support scripting and third party issues, we do help to our client for configuration/installation of such tools and technology.

    I know PHP scripting but not a expert developer and haven't played with ZF projects.
    So all you need to check the issue with your hosting support, you can also subscribe to
    Zend Framework Issue Tracker and get some help.

    Thank you.

    Regards,
    Kieran A.

  11. #11

    Default Hi Kieran - This might help me resolve

    Hi Kieran,

    It looks like I am getting somewhere with this zend framework and sorry if I am bothering you again but it seems like you are the only one who is willing to share their knowledge.

    I decided to install xampp and zend studio(which created the zend framwork project with the controllers and actions already structured inside.

    And I did what the Zend Quick Installation guide has asked to do but I am getting this error when I got to the //localhost in my browser

    Error:- For some reason it stops at this message -

    Index.php
    PHP Code:
    <?php
    Zend_Controller_Front
    ::run('/path/to/app/controllers');

    Error Message:-

    Fatal error: Class 'Zend_Controller_Front' not found in C:\xampp\htdocs\MyMusic\html\index.php on line 2


    Any clue what might be going wrong. I have tried other forums but no one seem to be writing back with any reply and my last resort for help is you..Please let me know if you have seen anything like this before.

    I am following - Zend Quick Installation Guide...which by far had not been quick in anyway.

    Your help would be appreciated at this stage.

    Regards
    Kannu

  12. #12
    Join Date
    Aug 2009
    Posts
    239

    Thumbs up

    Quote Originally Posted by kannu80 View Post
    Hi Kieran,

    It looks like I am getting somewhere with this zend framework and sorry if I am bothering you again but it seems like you are the only one who is willing to share their knowledge.
    No problem, You are most welcome Kannu.

    Quote Originally Posted by kannu80 View Post
    I decided to install xampp and zend studio(which created the zend framwork project with the controllers and actions already structured inside.

    And I did what the Zend Quick Installation guide has asked to do but I am getting this error when I got to the //localhost in my browser

    Error:- For some reason it stops at this message -

    Index.php
    PHP Code:
    <?php
    Zend_Controller_Front
    ::run('/path/to/app/controllers');

    Error Message:-

    Fatal error: Class 'Zend_Controller_Front' not found in C:\xampp\htdocs\MyMusic\html\index.php on line 2


    Any clue what might be going wrong. I have tried other forums but no one seem to be writing back with any reply and my last resort for help is you..Please let me know if you have seen anything like this before.
    I haven't used zend studio and not installed zend framwork on xampp/wamp.
    All the steps to install and configure Zend Framework under Linux Cpanel shared account are already mentioned here. I'm not experienced with Zend tools and still not sure with your problem so you can expect help from another developer who has faced same issue.

    Regards,
    Kieran A.

  13. #13

    Default

    Thanks for sharing such a useful post, hoping to see some more great posts like this from you in the future

  14. #14

    Default MySQL

    I am trying to get a Zend Framework running with MySQL server on a Cpanel shared server, what configuration changes do I need to make to get that running.
    For instance I had to add these lines to my php.ini for it to recognize my database:

    extension=pdo.so
    extension=pdo_mysql.so

    I also added these lines to my application.ini under [production]

    resources.db.adapter="PDO_MYSQL"
    resources.db.params.host="localhost"
    resources.db.params.username="username"
    resources.db.params.password="password"
    resources.db.params.dbname="username_DatabaseName"

    I had to add this to my .htaccess file to get the development environment.
    SetEnv APPLICATION_ENV development

    BTW, I have been trying to follow this tutorial on the Zend website:
    framework.zend.com/manual/en/learning.quickstart.create-model.html

    I seem to still be missing things, any ideas?

  15. #15

    Default

    Hi,

    We made a small application on Zend, It is running fine on local but when we uploaded it on godaddy linux shared hosting server it not working.

    Please check :
    aanandgroup.info/info.php
    aanandgroup.info/zend-test.php (test script for working of zend)
    And
    aanandgroup.info/public/(Form get open properly)

    whien you select Select type: admin, user name: sanjay, password:123

    New aanandgroup.info/public/index/authenticate

    Error is:
    __________________________________________________ _____
    Not Found

    The requested URL /public/index/authenticate was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Apache Server at aanandgroup.info Port 80

    __________________________________________________ ___

    Please help me out, i can provide ftp access also.

    Thanks
    Divyanshu Kumar
    fliegerindia.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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