Difference between revisions of "Workshop - week 01"

From mi-linux
Jump to navigationJump to search
Line 1: Line 1:
 
[[Main Page]] >> [[Web Frameworks]] >> [[Web Frameworks - Workbook]] >> Workshop - week 01
 
[[Main Page]] >> [[Web Frameworks]] >> [[Web Frameworks - Workbook]] >> Workshop - week 01
 +
 +
===PHP Info===
 +
 +
One thing that is not mentioned in the Quick Start, which is often a good idea to do when you begin working on a new PHP server for the first time is uploading a [http://uk2.php.net/phpinfo PHP Info] test file.
 +
 +
 +
<?php
 +
 +
// Shows all information, defaults to INFO_ALL
 +
 +
phpinfo();
 +
 +
?>
 +
 +
Browse to the page using your web broswer, and hopefully you should get a page outlining the various configurations on the server. If all appears well with the PHP info file, we can move on.
  
 
==Quick Start Zend Framework==
 
==Quick Start Zend Framework==
Line 7: Line 22:
 
Following how to [http://framework.zend.com/docs/quickstart/set-up-the-project-structure set up a project structure], we need to create a directory structure in our personal space.
 
Following how to [http://framework.zend.com/docs/quickstart/set-up-the-project-structure set up a project structure], we need to create a directory structure in our personal space.
  
Using either an FTP client (FileZilla, WS-FTP, etc), or using a Shell prompt through putty, set up the following folder structure:
+
Using either an FTP client ([http://filezilla-project.org/download.php FileZilla], WS-FTP, etc), or using a Shell prompt through [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty], set up the folder structure [http://framework.zend.com/docs/quickstart/set-up-the-project-structure outlined here.]
 +
 
 +
===Setting Up .htaccess===
 +
 
 +
Following the instructions outlined [http://framework.zend.com/docs/quickstart/create-a-rewrite-rule here], set up the .htaccess file, and copy it to the QuickStart/public/ folder.
  
QuickStart/  
+
Hint: When all the files are in place, page requests that would normally result in a 404 error should be redirected to the "Hello, Zend Framework!" page. For example, http://mi-linux.wlv.ac.uk/~0454543/QuickStart/public/notAPage should redirect correctly. If this is not working properly for you, you may need to change the final line of the rewrite  rule.
application/  
 
controllers/ views/ scripts/
 
library/  
 
public/
 
  
One thing that is not mentioned in the Quick Start, which is often a good idea to do when you begin working on a new PHP server for the first time is uploading a [http://uk2.php.net/phpinfo PHP Info] test file.
+
As an example:
 +
<div>
 +
# public/.htaccess
  
<source lang="php">
+
RewriteEngine On
<?php
+
RewriteCond %{REQUEST_FILENAME} -s [OR]
// Shows all information, defaults to INFO_ALL
+
RewriteCond %{REQUEST_FILENAME} -l [OR]
phpinfo();
+
RewriteCond %{REQUEST_FILENAME} -d
?>
+
RewriteRule ^.*$ - [NC,L]
</source>
+
'''RewriteRule ^.*$ /index.php [NC,L]'''
 +
</div>
 +
Would become:
 +
<div>
 +
RewriteEngine On
 +
RewriteCond %{REQUEST_FILENAME} -s [OR]
 +
RewriteCond %{REQUEST_FILENAME} -l [OR]
 +
RewriteCond %{REQUEST_FILENAME} -d
 +
RewriteRule ^.*$ - [NC,L]
 +
'''RewriteRule ^.*$ /~in9301/Zend/public/index.php [NC,L]'''
 +
</div>

Revision as of 01:39, 25 January 2009

Main Page >> Web Frameworks >> Web Frameworks - Workbook >> Workshop - week 01

PHP Info

One thing that is not mentioned in the Quick Start, which is often a good idea to do when you begin working on a new PHP server for the first time is uploading a PHP Info test file.


<?php

// Shows all information, defaults to INFO_ALL

phpinfo();

?>

Browse to the page using your web broswer, and hopefully you should get a page outlining the various configurations on the server. If all appears well with the PHP info file, we can move on.

Quick Start Zend Framework

We are going to be following the Zend Framework Quickstart tutorial to ensure we can get Zend to work properly from our University area.

Following how to set up a project structure, we need to create a directory structure in our personal space.

Using either an FTP client (FileZilla, WS-FTP, etc), or using a Shell prompt through putty, set up the folder structure outlined here.

Setting Up .htaccess

Following the instructions outlined here, set up the .htaccess file, and copy it to the QuickStart/public/ folder.

Hint: When all the files are in place, page requests that would normally result in a 404 error should be redirected to the "Hello, Zend Framework!" page. For example, http://mi-linux.wlv.ac.uk/~0454543/QuickStart/public/notAPage should redirect correctly. If this is not working properly for you, you may need to change the final line of the rewrite rule.

As an example:

  1. public/.htaccess

RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L]

Would become:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /~in9301/Zend/public/index.php [NC,L]