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 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗