create-framework-project-zf2.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <!-- Always force latest IE rendering engine or request Chrome Frame -->
  6. <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  8. <!-- Use title if it's in the page YAML frontmatter -->
  9. <title>Start a New Zend Framework 2 Project</title>
  10. <link href="/dashboard/stylesheets/normalize.css" rel="stylesheet" type="text/css" /><link href="/dashboard/stylesheets/all.css" rel="stylesheet" type="text/css" />
  11. <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  12. <script src="/dashboard/javascripts/modernizr.js" type="text/javascript"></script>
  13. <link href="/dashboard/images/favicon.png" rel="icon" type="image/png" />
  14. </head>
  15. <body class="docs docs_create-framework-project-zf2">
  16. <div id="fb-root"></div>
  17. <script>(function(d, s, id) {
  18. var js, fjs = d.getElementsByTagName(s)[0];
  19. if (d.getElementById(id)) return;
  20. js = d.createElement(s); js.id = id;
  21. js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=277385395761685";
  22. fjs.parentNode.insertBefore(js, fjs);
  23. }(document, 'script', 'facebook-jssdk'));</script>
  24. <div class="contain-to-grid">
  25. <nav class="top-bar" data-topbar>
  26. <ul class="title-area">
  27. <li class="name">
  28. <h1><a href="/dashboard/index.html">Apache Friends</a></h1>
  29. </li>
  30. <li class="toggle-topbar menu-icon">
  31. <a href="#">
  32. <span>Menu</span>
  33. </a>
  34. </li>
  35. </ul>
  36. <section class="top-bar-section">
  37. <!-- Right Nav Section -->
  38. <ul class="right">
  39. <li class=""><a href="/applications.html">Applications</a></li>
  40. <li class=""><a href="/dashboard/faq.html">FAQs</a></li>
  41. <li class="active"><a href="/dashboard/howto.html">HOW-TO Guides</a></li>
  42. <li class=""><a target="_blank" href="/dashboard/phpinfo.php">PHPInfo</a></li>
  43. <li class=""><a href="/phpmyadmin/">phpMyAdmin</a></li>
  44. </ul>
  45. </section>
  46. </nav>
  47. </div>
  48. <div id="wrapper">
  49. <div class="hero">
  50. <div class="row">
  51. <div class="large-12 columns">
  52. <h1>Documentation</h1>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="row">
  57. <div class="large-12 columns">
  58. <ul class="sub-nav">
  59. <li>
  60. <a class="pdf" target="_blank" href="/dashboard/docs/create-framework-project-zf2.pdf"> Download PDF
  61. <span>create-framework-project-zf2.pdf</span>
  62. </a> </li>
  63. </ul>
  64. <article class="asciidoctor">
  65. <h1>Start a New Zend Framework 2 Project</h1>
  66. <div class="paragraph">
  67. <p>XAMPP makes it easy to start developing with PHP, and <a href="http://framework.zend.com/">Zend Framework 2</a> is one of the most popular PHP development frameworks. This guide walks you through the process of initializing a new Zend Framework 2 project with XAMPP.</p>
  68. </div>
  69. <div class="admonitionblock note">
  70. <table>
  71. <tr>
  72. <td class="icon">
  73. <i class="fa icon-note" title="Note"></i>
  74. </td>
  75. <td class="content">
  76. This guide assumes that you have already downloaded and installed Git for Windows, and that the git binary is in your Windows PATH. If you don&#8217;t have Git for Windows, you can <a href="http://git-scm.com/download/win">download and install it from here</a>. It also assumes that the new Zend Framework 2 application will be accessible at the URL <a href="http://localhost/myapp/" class="bare">http://localhost/myapp/</a>.
  77. </td>
  78. </tr>
  79. </table>
  80. </div>
  81. <div class="paragraph">
  82. <p>Follow these steps:</p>
  83. </div>
  84. <div class="olist arabic">
  85. <ol class="arabic">
  86. <li>
  87. <p><a href="https://github.com/zendframework/ZendSkeletonApplication">Download the Zend Framework 2 skeleton application</a> as a ZIP archive from Github.</p>
  88. <div class="imageblock">
  89. <div class="content">
  90. <img src="./images/create-framework-project-zf2/image1.png" alt="image1">
  91. </div>
  92. </div>
  93. </li>
  94. <li>
  95. <p>Within your XAMPP installation directory (usually <em>C:\xampp</em>), create a new directory named <em>apps\</em> (if it doesn&#8217;t already exist). Then, within this new <em>apps\</em> directory, create a directory to hold your Zend Framework 2 application and its related XAMPP configuration files. In this example, call the directory <em>myapp\</em>.</p>
  96. </li>
  97. <li>
  98. <p>Extract the contents of the ZIP archive to the <em>myapp\</em> directory. This will produce a <em>zendframework-ZendSkeletonApplication-[xx]\</em> subdirectory in the <em>myapp\</em> directory. Rename this newly-created subdirectory to <em>htdocs</em>.</p>
  99. <div class="admonitionblock note">
  100. <table>
  101. <tr>
  102. <td class="icon">
  103. <i class="fa icon-note" title="Note"></i>
  104. </td>
  105. <td class="content">
  106. This new <em>htdocs</em> directory will be the main working directory for your Zend Framework 2 project.
  107. </td>
  108. </tr>
  109. </table>
  110. </div>
  111. </li>
  112. <li>
  113. <p>Within the <em>myapp\</em> directory, create a new <em>conf\</em> subdirectory.</p>
  114. <div class="olist loweralpha">
  115. <ol class="loweralpha" type="a">
  116. <li>
  117. <p>Within the new <em>conf\</em> subdirectory, use your text editor to create and populate a file named <em>httpd-prefix.conf</em> with the following content:</p>
  118. <div class="literalblock">
  119. <div class="content">
  120. <pre>Alias /myapp/ "C:/xampp/apps/myapp/htdocs/public/"
  121. Alias /myapp "C:/xampp/apps/myapp/htdocs/public"
  122. Include "C:/xampp/apps/myapp/conf/httpd-app.conf"</pre>
  123. </div>
  124. </div>
  125. </li>
  126. <li>
  127. <p>Within the <em>conf\</em> subdirectory, also create and populate a file named <em>httpd-app.conf</em> with the following content:</p>
  128. <div class="literalblock">
  129. <div class="content">
  130. <pre>&lt;Directory C:/xampp/apps/myapp/htdocs/public&gt;
  131. Options +FollowSymLinks
  132. AllowOverride All
  133. Require all granted
  134. &lt;/Directory&gt;</pre>
  135. </div>
  136. </div>
  137. </li>
  138. </ol>
  139. </div>
  140. </li>
  141. <li>
  142. <p>Edit the <em>httpd-xampp.conf</em> file in the <em>apache\conf\extra\</em> subdirectory of your XAMPP installation directory and add the following line at the end to include the <em>httpd-prefix.conf</em> file created earlier.</p>
  143. <div class="literalblock">
  144. <div class="content">
  145. <pre>Include "C:/xampp/apps/myapp/conf/httpd-prefix.conf"</pre>
  146. </div>
  147. </div>
  148. <div class="admonitionblock note">
  149. <table>
  150. <tr>
  151. <td class="icon">
  152. <i class="fa icon-note" title="Note"></i>
  153. </td>
  154. <td class="content">
  155. Remember to update the above file and directory paths so that they&#8217;re valid for your system.
  156. </td>
  157. </tr>
  158. </table>
  159. </div>
  160. </li>
  161. <li>
  162. <p>Check that you have a directory structure like this:</p>
  163. <div class="imageblock">
  164. <div class="content">
  165. <img src="./images/create-framework-project-zf2/image2.png" alt="image2">
  166. </div>
  167. </div>
  168. </li>
  169. <li>
  170. <p>Restart the Apache server using the XAMPP control panel.</p>
  171. </li>
  172. <li>
  173. <p>Launch a new Windows command shell using the "Shell" button in the XAMPP control panel.</p>
  174. <div class="imageblock">
  175. <div class="content">
  176. <img src="./images/create-framework-project-zf2/image3.png" alt="image3">
  177. </div>
  178. </div>
  179. </li>
  180. <li>
  181. <p>Within the command shell, change to the <em>myapp\htdocs\</em> directory and run the following commands to update <a href="https://getcomposer.org/">Composer</a> (the PHP dependency manager) and install the Zend Framework 2 components.</p>
  182. <div class="literalblock">
  183. <div class="content">
  184. <pre>php composer.phar self-update
  185. php composer.phar install</pre>
  186. </div>
  187. </div>
  188. <div class="paragraph">
  189. <p>Here&#8217;s an example of what you might see as Composer downloads and installs dependencies.</p>
  190. </div>
  191. <div class="imageblock">
  192. <div class="content">
  193. <img src="./images/create-framework-project-zf2/image4.png" alt="image4">
  194. </div>
  195. </div>
  196. </li>
  197. <li>
  198. <p>Once Composer is done, you should be able to access the Zend Framework 2 skeleton application by browsing to <a href="http://localhost/myapp" class="bare">http://localhost/myapp</a>. Here is an example of the default welcome page you should see:</p>
  199. <div class="imageblock">
  200. <div class="content">
  201. <img src="./images/create-framework-project-zf2/image5.png" alt="image5">
  202. </div>
  203. </div>
  204. </li>
  205. </ol>
  206. </div>
  207. <div class="paragraph">
  208. <p>You can now begin developing your Zend Framework 2 application by modifying the skeleton application code. For more information, <a href="http://framework.zend.com/manual/2.3/en/user-guide/overview.html">refer to the Zend Framework 2 User Guide</a>.</p>
  209. </div>
  210. </article>
  211. </div>
  212. </div>
  213. </div>
  214. <footer>
  215. <div class="row">
  216. <div class="large-12 columns">
  217. <div class="row">
  218. <div class="large-8 columns">
  219. <ul class="social">
  220. <li class="twitter"><a href="https://twitter.com/apachefriends">Follow us on Twitter</a></li>
  221. <li class="facebook"><a href="https://www.facebook.com/we.are.xampp">Like us on Facebook</a></li>
  222. <li class="google"><a href="https://plus.google.com/+xampp/posts">Add us to your G+ Circles</a></li>
  223. </ul>
  224. <ul class="inline-list">
  225. <li><a href="https://www.apachefriends.org/blog.html">Blog</a></li>
  226. <li><a href="https://www.apachefriends.org/privacy_policy.html">Privacy Policy</a></li>
  227. <li>
  228. <a target="_blank" href="http://www.fastly.com/"> CDN provided by
  229. <img width="48" data-2x="/dashboard/images/fastly-logo@2x.png" src="/dashboard/images/fastly-logo.png" />
  230. </a> </li>
  231. </ul>
  232. </div>
  233. <div class="large-4 columns">
  234. <p class="text-right">Copyright (c) 2017, Apache Friends</p>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </footer>
  240. <!-- JS Libraries -->
  241. <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
  242. <script src="/dashboard/javascripts/all.js" type="text/javascript"></script>
  243. </body>
  244. </html>