-
Couldn't load subscription status.
- Fork 16
Setup
This section provides you with basic information for download, setup and configure WebMVC framework.
In order to develop using WebMVC framework you need:
- Operating System: Linux, Mac or Windows
- Server: Apache web server with mod_rewrite enabled
- Database: MySQL (from 5.0 to the latest version)
- Programming language: PHP (from 5.3 to the latest version) with DOM, MySQLi and GD extensions enabled
The technical skills you need for developing with WebMVC are:
- Good knowledge of PHP programming language and OOP
- Basic knowledge of HTML, JavaScript, and CSS
- Basic knowledge of MySQL database
To create a new PHP Web MVC project in a given project folder, open a terminal session and run:
composer create-project rcarvello/webmvcframework PROJECT-FOLDER Then go into PROJECT-FOLDER:
cd PROJECT-FOLDER Configure DB access:
php setup-config.php You will be prompted to specify certain configuration variables, such as the database host, username, password, etc.
Finally, you can run the development server simply by typing:
composer run dev The development server will be started by enabling hot reload on any code changes.
Your web browser will open the demo page at http://localhost:3000
To install the framework:
- Download it from Github
- Create a project folder in the root folder of your web server
- Copy all the directories downloaded from Github into the project folder
- Run
sql/mrp.sqlto install database sample tables. See the comments insidesql/mrp.sqlto see default users and passwords - Go into the project folder and modify the following lines of
config/application.config.phpaccording to your MySQL database and Apache Web Server configuration
/** * MySQL User */ define("DBUSER","PUT_YOUR_USERNAME"); /** * MySQL Password */ define("DBPASSWORD","PUT_YOUR_PASSWORD"); /** * MySQL Database */ define("DBNAME","PUT_YOUR_DB_NAME"); /** * MySQL Port */ define('DBPORT', '3306'); /** * Defines a constant for site URL * @note without the ending slash * @example: http://localhost/webmvc */ define("SITEURL","http://PUT_YOUR_HOST/PUT_YOUR_WEB_FOLDER"); /** * Defines a constant for indicating the default login controller * You can use URL notation for specifying your custom Controller */ define("DEFAULT_LOGIN_PAGE", "common/login"); /** * Instructs framework if MySQL uses FULL_GROUP_BY SQL mode. * On MySQL > 5.7 FULL_GROUP_BY is enabled by default. * When MySQL FULL_GROUP_BY is ON set this constant to true * else false. * Note: * FULL_GROUP_BY ON reduces the Paginator component performances. * So is highly recommended to configure your MySQL and set it * to OFF. */ define ("MYSQL_MODE_FULL_GROUP_BY",false); ....... /** * Defines a constant for a temporary folder */ define("APP_TEMP_PATH", "D:\\gitmvc\\temp");Finally, make sure you set it properly Apache configuration for enabling mod_rewrite. Look here for details
In the next section, we show you how to configure some advanced option. Alternatively, you can start understanding how WebMVC works.