Install Zend Framework on openSUSE / openSUSE 12.1
Zend Framework is an open source, object oriented web application framework for PHP 5. Zend Framework is often called a ‘component library’, because it has many loosely coupled components that you can use more or less independently. But Zend Framework also provides an advanced Model-View-Controller (MVC) implementation that can be used to establish a basic structure for your Zend Framework applications.
Zend Framework features include:
- All components are fully object-oriented PHP 5 and are E_STRICT compliant
- Use-at-will architecture with loosely coupled components and minimal interdependencies
- Extensible MVC implementation supporting layouts and PHP-based templates by default
- Support for multiple database systems and vendors, including MariaDB, MySQL, Oracle, IBM DB2, Microsoft SQL Server, PostgreSQL, SQLite, and Informix Dynamic Server
- Email composition and delivery, retrieval via mbox, Maildir, POP3 and IMAP4
- Flexible caching sub-system with support for many types of backends, such as memory or a file system.
Zend Framework can be tested by creating test project; it should be placed under the document root of your web server. Web server might be Apache, Nginx and Lighttpd; for easy understanding i used Apache as web server. Here is the Step by Step guide to install LAMP server on openSUSE 12.
Open Terminal and then switch to root user.
[email protected]:~ $ su
Install Zend Framework:
Add repository for Zend Framework.
[email protected]:~ # zypper ar http://download.opensuse.org/repositories/server:/monitoring/openSUSE_12.1 zend
Refresh the system repositories, you might requires to accept the key for caching the Zend repo.
[email protected]:~ # zypper ref
Install Zend Framework on openSUSE 12.1.
[email protected]:~ # zypper in php5-ZendFramework
Confirm the installed version.
r[email protected]:~ # zf show version Zend Framework Version: 1.11.10
Testing Zend project:
In Apache /srv/www/htdocs/ is the default document root, so i am going to create test project on /srv/www/htdocs/, go to the default document root of web server.
[email protected]:~ # cd /srv/www/htdocs/
Create the test project called geeksite.
[email protected] htdocs:~ # zf create project geeksite Creating project at /srv/www/htdocs/geeksite Note: This command created a web project, for more information setting up your VHOST, please see docs/README Testing Note: PHPUnit was not found in your include_path, therefore no testing actions will be created.
You should get the above message after hitting Enter; if you get any error message included in above message, you required to install PHPUnit.
Now we need to have the Zend Library files in the library directory under the created project (By default it’s empty). go to the library directory.
[email protected] geeksite:~ # cd geeksite/library/
SymLink is the better option than copying the library files to library directory; because the library files will get update when we are installing the latest Zend Framework.
[email protected] library:~ # ln -s /usr/share/php5/Zend .
Tree view of your project directory.
[email protected] geeksite:~ # tree . ├── application │ ├── Bootstrap.php │ ├── configs │ │ └── application.ini │ ├── controllers │ │ ├── ErrorController.php │ │ └── IndexController.php │ ├── models │ └── views │ ├── helpers │ └── scripts │ ├── error │ │ └── error.phtml │ └── index │ └── index.phtml ├── docs │ └── README.txt ├── library ├── public │ └── index.php └── tests ├── application │ └── controllers │ └── IndexControllerTest.php ├── bootstrap.php ├── library └── phpunit.xml 16 directories, 11 files
Open up a web browser and navigate to http://localhost/geeksite/public. Screen Shot of Test Project in openSUSE 12.1.