To create a new database, open an instance of phpMyAdmin in your web browser and follow the steps described here:
Open phpMyAdmin in your web browser by visiting
http://localhost/phpmyadmin
:Choose Databases, enter the name of the new database as
zf_app
in Create new database, and click on Create:After creating the database, create a database user for this database; this can be done by selecting Add a new user from Privileges. Provide the following details:
After doing this you will get the following screen:
After the user is created, go to the Privileges section and choose Edit Privileges for the
zf_user
.In the Database-specific privileges section, select the
zf_app
database.You will be redirected to the privileges section of the
zf_app
database for thezf_user
user. Choose Check All and click on Go.
You can now test the database by logging out of phpMyAdmin and logging in again with the user credentials of zf_user
. You should now be able to see only the zf_app
database.
We just created our first database in MySQL. We have also created a user in the database and mapped the user to the database with administrative rights; we can now use these credentials in the application that we will be building in our next chapters.
Now that you have the PHP web server up and running and also have a MySQL database, create a simple table called Students
and add a few records to the table using phpMyAdmin.
Your task will be to create a simple PHP web page that will display all the records in the Students
table in the page.
Q1. What is the minimum version of PHP needed to run Zend Framework 2.0?
PHP 4.3 and above
PHP 5.2.0 and above
PHP 5.3.3 and above
PHP 5.4.7 and above
Q2. What is the default location of php.ini
in the new Zend Server installation?
/home/<user>/etc/php/php.inc
/etc/php/php.ini
/var/www/php.ini
/usr/local/zend/etc/php.ini