meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
develop:developmentsetup [2016/11/16 15:57] – samtuke | develop:developmentsetup [2017/07/14 15:39] (current) – [phpList database configuration] samtuke | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | //**Note:** It is recommended to use **Docker** for setting up your development environment instead. This is the officially supported method. See the [[Docker|docker setup guide]].// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Development environment setup ====== | ||
+ | |||
+ | ===== Local setup ===== | ||
+ | |||
+ | These steps explain how to run phpList from the latest code on your local machine, for development. | ||
+ | |||
+ | We expect you to have a machine that runs Apache with mod_php and Mysql. Feel free to add instructions for other setups. | ||
+ | |||
+ | ==== Apache ==== | ||
+ | |||
+ | For apache add a virtual host on your machine | ||
+ | |||
+ | < | ||
+ | ServerName devel.localdev.phplist.com | ||
+ | DocumentRoot / | ||
+ | SetEnv ConfigFile / | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | === Explanation === | ||
+ | |||
+ | * ServerName **devel**.localdev.phplist.com | ||
+ | [ANYTHING].localdev.phplist.com always resolves to 127.0.0.1, so it points back to your own machine. This does require you to be online, so if you want to work offline, you can use any other hostname and put it in your hosts file to point back to your machine. | ||
+ | |||
+ | * DocumentRoot | ||
+ | Point this to where you put the code from SVN. You will want the Apache Document root to be the " | ||
+ | |||
+ | * SetEnv ConfigFile / | ||
+ | it is useful to keep your local development config outside of the coderoot. | ||
+ | |||
+ | ==== Themes / web interface ==== | ||
+ | |||
+ | phpLists' | ||
+ | |||
+ | The standard phpList is Dressprow. Clone the theme from the official repository into your theme directory, which is: | ||
+ | |||
+ | < | ||
+ | |||
+ | You can install other themes also into that folder, or make your own. | ||
+ | |||
+ | To configure phpList to use a particular theme, set the following value in phpList' | ||
+ | |||
+ | < | ||
+ | |||
+ | ==== Campaign editor / WYSIWYG ==== | ||
+ | |||
+ | To enable a graphical editor for HTML campaigns, you need to install an editor plugin. For example you may install the CKEditor plugin to enable that editor for composing and reviewing campaign content. | ||
+ | |||
+ | ==== Mysql ==== | ||
+ | |||
+ | Create a database for phpList, or use an existing one. You can probably use phpMyAdmin to create something, or just do | ||
+ | |||
+ | < | ||
+ | mysqladmin -uroot -prootpassword create phplistdb | ||
+ | mysql -uroot -prootpassword -e "grant all on phplistdb.* to phplist@localhost identified by ' | ||
+ | </ | ||
+ | |||
+ | If you want to kickstart your system with some data, you can download [[http:// | ||
+ | |||
+ | Fill your database with the following command | ||
+ | < | ||
+ | gunzip -c phplist-devdb.sql.gz | mysql -uphplist -pdbpass phplistdb | ||
+ | </ | ||
+ | |||
+ | ==== phpList database configuration ==== | ||
+ | |||
+ | Where you pointed the VirtualHost to look for the phpList config, create the file (in the above example, | ||
+ | |||
+ | Minimum requirements for the config file are: | ||
+ | < | ||
+ | $database_name = " | ||
+ | $database_host = " | ||
+ | $database_user = " | ||
+ | $database_password = " | ||
+ | $developer_email = ' | ||
+ | /* Uncomment the line below if you are using database dump above. */ | ||
+ | // | ||
+ | </ | ||
+ | |||
+ | It will be best to try to run everything without any PHP errors (including notices) showing up. To get errors in a nice way, you should consider installing [[http:// | ||
+ | |||
+ | In order for the errors to actually show, use this in your config file: | ||
+ | |||
+ | < | ||
+ | $GLOBALS[' | ||
+ | </ | ||
+ | |||
+ | === Reinstalling / reinitialising the database === | ||
+ | |||
+ | If a new database is used with an existing phpList server you will need to reinitialise the database to install the phpList tables again. The following errors will appear until you do this: | ||
+ | |||
+ | < | ||
+ | |||
+ | You can reinitialise a new database by visiting the following URL at any time: | ||
+ | |||
+ | < | ||
+ | ===== Working with custom plugins ===== | ||
+ | |||
+ | Once you have the basics running, there are a few options that facilitate [[develop/ | ||
+ | |||
+ | < | ||
+ | PLUGIN_ROOTDIR = " | ||
+ | </ | ||
+ | |||
+ | If you set the above, phpList will use the '' | ||
+ | |||
+ | However, you will want to be able to create your own plugins. In order to tell phpList about the code location of your local plugins, you can use | ||
+ | |||
+ | < | ||
+ | PLUGIN_ROOTDIRS = "/ | ||
+ | </ | ||
+ | |||
+ | and phpList will look in ''/ | ||
+ | |||
+ | Make sure to follow the [[/ | ||