dsjpqpdm620596 2012-03-24 21:16
浏览 84
已采纳

如何将Zend Framework应用程序部署到PHP Fog?

I am new to PHP. I have a PHP application which I need to deploy to PHP Fog. I have already configured the database and the credentials to use the remote repository using git. I can push the content to PHP fog.

The problem is that I don't understand what I have to push, why I have so many folders.

The zip file contains the following folders: application library nbproject public 1.clpprj (What is this?)

application contains the folders: configs, forms, layouts, models, modules, pdf and the file Bootstrap.php which starts with the following line: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap.

public contains a lot of folders and files. I think that this is the root of the project. it contains folders like img, js, fonts, css, the file index.php.

I received the following instructions:

1) define the folder for hosting, if you have access to the root of the site that copy all the are stored in the "public" folder in the archive to the root of the site

2) if you have access to one directory above the root of the site, then copy there all the other folders (except for "public") .

Any help deploying this application?

  • 写回答

2条回答 默认 最新

  • dongqing4774 2012-03-26 01:24
    关注

    The minimally required folders in the Zend Framework are the bin and library folders. The other folders are accessories and samples. The library folder along with your application need to be pushed to PHP Fog.

    The application folder is where you will create controllers, models, and views for your app. The library folder is where you would place reusable code needed by one or more controller. nbproject and .clpprj files are associated with the NetBeans IDE.

    Here is a quick start tutorial that will get you up and running with a starter app on PHP Fog. Once you get this working you should be able to use the code from the application code you downloaded.

    1. Create a new PHP Custom app from the PHP Fog console

    2. Clone it to your local machine (I'm assuming MacOS or Linux). Change directory to the cloned folder.

    3. Place all the files and folders from the Zend Framework Zend Framework 1.11 full download into the cloned folder.

    4. Create a .gitignore file in the cloned folder with the following contents:

      demos
      externals
      extras
      incubator
      resources
      src
      tests
      
    5. From the cloned folder run the following command to create a new application:

      bin/zf.sh create project myproject

      This creates a new folder named myproject. At this point your cloned project folder should look like this:

      INSTALL.txt README.txt  demos       extras      index.php   myproject   src
      LICENSE.txt bin         externals   incubator   library     resources   tests
      
    6. Edit the myproject/public/index.php file and add the root library along with the project library to the includes paths.

      // Ensure library/ is on include_path
      set_include_path(implode(PATH_SEPARATOR, array(
          realpath(APPLICATION_PATH . '/../library'), // <----Keep this line
          realpath(APPLICATION_PATH . '/../../library'), // <----- Add This line
          get_include_path(),
      )));
      
    7. In the PHP Fog console under setting set the following base path:

      myproject/public

    8. Add the changes to the repo and push to PHP Fog

      git add -A
      git commit -m "First Commit"
      git push
      

    Wait a few seconds after the push and your app should deploy with the default "Welcome to the Zend Framework!" 404 page.

    I would then take a look at this article Zend Framework from Scratch and skip to step 4.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?