Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Installing CakePHP
Jill Gundersen
Installing CakePHP
 CakePHP Can Be Run on Any OS


I will cover installation on the following machines






Linux ...
CakePHP Requirements
 PHP Version


5.2.8 or Higher

 Database


MySQL, PostgreSQL, Microsoft SQL Server, SQLite


My...
Installing CakePHP on Linux
 Command Line for Our Installation


For this course I will be using the Ubuntu OS, but the ...
Initial Setup Environment
 Building on the LAMP Stack –
Linux, Apache, MySQL, PHP




Linux
Apache Web Server
MySQL

...
Configure CakePHP
 Create a Folder for Our New CakePHP Site


Move the CakePHP you downloaded into this folder



I li...
Configure Apache Web Server
 Alter the ‘etc/hosts’ File


Add Catalog after ‘localhost’


Make sure there is a space be...
Install CakePHP with NetBeans
 Installation of CakePHP with the NetBeans IDE


Most IDEs will work for development, but ...
Initial Setup Environment
 Building on the LAMP Stack –
Linux, Apache, MySQL, PHP




Linux
Apache Web Server
MySQL

...
NetBeans Magic
 CakePHP Plugin


Using NetBeans plugin manager, select and install the CakePHP plugin

 Create a New Pr...
Configure Apache Web Server
 Alter the ‘etc/hosts’ File


Add CatalogTest

 Create a New VirtualHost File


Located in...
Installing CakePHP on Windows Using XAMPP
 Install the XAMPP Application


Includes




Apache Web Server
MySQL
PHP

...
Initial Setup Environment
 Windows OS


I will be using Windows 7

 Download XAMPP Installer Version


You can find th...
Installing XAMPP
 Default Program Options




You can uncheck any programs you don’t
want to install.
Make sure that yo...
Configure CakePHP
 Create a folder for our new CakePHP site


Move the CakePHP you downloaded into this folder



I li...
Configure XAMPP
 Alter the ‘C:WindowsSystem32driversetchosts’ file


Add Catalog and localhost entries


http://Catalog...
Install CakePHP with NetBeans
 Installation of CakePHP with the NetBeans IDE


Most IDEs will work for development, but ...
Initial Setup Environment
 Windows OS


I will be using Windows 7

 XAMPP


Downloaded and installed

 NetBeans


Do...
NetBeans Magic
 CakePHP Plugin


Using NetBeans plugin manager, select and install the CakePHP plugin

 Create a New Pr...
Configure XAMPP
 Alter the ‘C:WindowsSystem32driversetchosts’ file


Add CatalogTest

 Add a VirtualHost Entry


Locat...
CakePHP with Windows IIS Server
 No More Software, please


For those that want to stick with the IIS server and not hav...
Initial Setup
 Web Platform Installer


Below is a list of items you will need in order to run CakePHP on your IIS
syste...
IIS Configuration
 Create New Site


Catalog (choose the correct local path)

 Add a New Default Document


index.php
...
URL Rewrite
 URL Rewrite Not Natively Handled


IIS does not handle the rewriting of rules as found in the Apache web se...
Common Issues & Mistakes
 Below is List of Common Installation Problems


Database won’t connect



Did you create the...
Summary
 Installed CakePHP on…






Linux
Linux with NetBeans
Windows
Windows with NetBeans
Windows with IIS Server...
Upcoming SlideShare
Loading in …5
×

2 introduction-php-mvc-cakephp-m2-installation-slides

5,330 views

Published on

Video https://www.youtube.com/watch?v=KjPTQFmynSQ&list=PLLQgkMVoGtct3te5fakbmLYZH9x00iOex&index=2

Published in: Education, Technology
  • For installing and hosting CakePHP on a cloud server, I would recommend to use Cloudways CakePHP hosting platform. (https://www.cloudways.com/en/cakephp-hosting.php ) This platform lets you launch a server, with OS and stack already installed, instantly.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

2 introduction-php-mvc-cakephp-m2-installation-slides

  1. 1. Installing CakePHP Jill Gundersen
  2. 2. Installing CakePHP  CakePHP Can Be Run on Any OS  I will cover installation on the following machines      Linux command line Linux with NetBeans IDE Window using XAMPP Windows with NetBeans IDE Windows with IIS  URL Alteration   In each OS installation scenario I will also cover how to make a pretty URL http://catalog  (instead of using http://localhost/catalog)
  3. 3. CakePHP Requirements  PHP Version  5.2.8 or Higher  Database  MySQL, PostgreSQL, Microsoft SQL Server, SQLite  MySQL with phpMyAdmin  Web Server  Apache, IIS
  4. 4. Installing CakePHP on Linux  Command Line for Our Installation  For this course I will be using the Ubuntu OS, but the process is similar on other flavors of Linux.
  5. 5. Initial Setup Environment  Building on the LAMP Stack – Linux, Apache, MySQL, PHP    Linux Apache Web Server MySQL   Make sure you have your username/password handy Create a database for our course   Catalog PHP  Version 5.2.8 or higher  Additionally  Download CakePHP   git://github.com/cakephp/cakephp.git https://github.com/cakephp/cakephp/zipball/2.3.6
  6. 6. Configure CakePHP  Create a Folder for Our New CakePHP Site  Move the CakePHP you downloaded into this folder   I like to keep my individual web sites under a WebSites folder etc. /home/<username>/WebSites/Catalog  Change the Permissions on the CakePHP app/tmp Folder  chmod 777 -R tmp  Alter Two Files in the CakePHP app/config Folder   database.php.default core.php
  7. 7. Configure Apache Web Server  Alter the ‘etc/hosts’ File  Add Catalog after ‘localhost’  Make sure there is a space between the two  Create a New VirtualHost File  Located inside the /etc/apache2/sites-available  Hint: Copy the default file and rename that to be Catalog  Enable the New Site  a2ensite Catalog  Reload Apache  This allows Apache to recognize the changes we just made to the configuration
  8. 8. Install CakePHP with NetBeans  Installation of CakePHP with the NetBeans IDE  Most IDEs will work for development, but NetBeans has a nice CakePHP plugin that helps with installation and setup of CakePHP.  As a bonus it also has code completion.
  9. 9. Initial Setup Environment  Building on the LAMP Stack – Linux, Apache, MySQL, PHP    Linux Apache Web Server MySQL   Make sure you have your username/password handy Create a database for our course   Catalog PHP  Version 5.2.8 or higher  Additionally  Download and Install NetBeans IDE  http://www.netbeans.org
  10. 10. NetBeans Magic  CakePHP Plugin  Using NetBeans plugin manager, select and install the CakePHP plugin  Create a New Project  Using the new framework template, create a new CakePHP Project  CatalogTest
  11. 11. Configure Apache Web Server  Alter the ‘etc/hosts’ File  Add CatalogTest  Create a New VirtualHost File  Located inside the /etc/apache2/sites-available  Enable the New Site  a2ensite CatalogTest  Reload Apache  This will get apache to recognize the changes we have made to the VirtualHosts folder
  12. 12. Installing CakePHP on Windows Using XAMPP  Install the XAMPP Application  Includes    Apache Web Server MySQL PHP  Install CakePHP in Our New XAMPP Environment on Windows
  13. 13. Initial Setup Environment  Windows OS  I will be using Windows 7  Download XAMPP Installer Version  You can find the latest from   http://www.apachefriends.org/en/xampp.html Download the version with the Windows Installer  Download CakePHP  https://github.com/cakephp/cakephp/zipball/2.3.6
  14. 14. Installing XAMPP  Default Program Options   You can uncheck any programs you don’t want to install. Make sure that you leave phpMyAdmin, and MySQL checked.  Install off of the C: Drive  C:xampp  Start Apache and MySQL  You can minimize the control panel and it will still run in the background.
  15. 15. Configure CakePHP  Create a folder for our new CakePHP site  Move the CakePHP you downloaded into this folder   I like to keep my individual web sites under a WebSites folder etc. C:PluralsightWebSitesCatalog  Alter two files in the CakePHP app/config folder   database.php.default core.php
  16. 16. Configure XAMPP  Alter the ‘C:WindowsSystem32driversetchosts’ file  Add Catalog and localhost entries  http://Catalog  Add a VirtualHost Entry  Located inside the C:xamppapacheconfextrahttpd-vhosts.conf  Restart Apache  Open up the XAMPP control panel and stop and then start Apache
  17. 17. Install CakePHP with NetBeans  Installation of CakePHP with the NetBeans IDE  Most IDEs will work for development, but NetBeans has a nice CakePHP plugin that helps with installation and setup of CakePHP.  As a bonus it also has code completion.
  18. 18. Initial Setup Environment  Windows OS  I will be using Windows 7  XAMPP  Downloaded and installed  NetBeans  Downloaded and installed
  19. 19. NetBeans Magic  CakePHP Plugin  Using NetBeans plugin manager, select and install the CakePHP plugin  Create a New Project  Using the new framework template, create a new CakePHP Project  CatalogTest
  20. 20. Configure XAMPP  Alter the ‘C:WindowsSystem32driversetchosts’ file  Add CatalogTest  Add a VirtualHost Entry  Located inside the C:xamppapacheconfextrahttpd-vhosts.conf  Restart Apache  Open up the XAMPP control panel and stop and then start Apache
  21. 21. CakePHP with Windows IIS Server  No More Software, please  For those that want to stick with the IIS server and not have to install XAMPP this section is for you.
  22. 22. Initial Setup  Web Platform Installer  Below is a list of items you will need in order to run CakePHP on your IIS system       IIS (Express) IIS Manager PHP (latest version 5.4 <) PHP Manager for IIS MySQL Server 5.1 (or most recent) URL Rewrite 2.0 (this is to handle the rewrite rules that CakePHP utilizes)
  23. 23. IIS Configuration  Create New Site  Catalog (choose the correct local path)  Add a New Default Document  index.php  PHP Manager    Make sure that the suggested optimizations are in place. Check the latest version that it is greater than 5.2.8 Check to make sure the phpinfo() file runs  This means that php was installed succesfully
  24. 24. URL Rewrite  URL Rewrite Not Natively Handled  IIS does not handle the rewriting of rules as found in the Apache web server.  Create a web.config  This file should reside in the base folder  Catalog/web.config  Copy and Paste   Copy and past the necessary rules for the CakePHP site into the web.config. http://alturl.com/to9z4 (CakePHP’s URL Rewrite Page)
  25. 25. Common Issues & Mistakes  Below is List of Common Installation Problems  Database won’t connect   Did you create the database? Did you create new user?   Did you type the user name and password correctly?   Did you give that user permissions for the new database? Use the root/password to see if that will connect properly. If it does then there is something wrong with your username My styles are not showing  IIS Server    Did you install the web.config with the xml rules? Did you install URL Rewrite for your IIS server? Apache  Did you set the “AllowOverride” to be “All” in your VirtualHost?
  26. 26. Summary  Installed CakePHP on…      Linux Linux with NetBeans Windows Windows with NetBeans Windows with IIS Server  URL/Virtual Host  Set up on each Install for pretty URLs

×