Skip to content
Jean J. de Jong edited this page Oct 21, 2019 · 35 revisions

The back-end for operating v2 is identical to that for v1 (Apache, PHP, MySQL, and a virtual host setup pointing to the public sub-folder...). See the v1 instructions. However, you need MySQL version 5.7 or greater (or MariaDB 10.2 or greater), supporting virtual columns.

To get going

  • Clone the phpip-v2 Git repository to a folder, say phpip-v2.
  • Install composer, then run composer install in the phpip-v2 folder.
  • Create an .env file with your database credentials (copy and tailor the provided .env.example file).
  • Run php artisan key:generate; php artisan config:clear (a command-line php is required).

Starting a new database

  • Run php artisan migrate --seed This creates a blank database with basic configuration. You're ready to go with the credentials phpipuser/changeme.

  • For adding sample data, run php artisan db:seed --class=SampleSeeder.

Migrating an existing v1 installation

  • Copy the phpip MySQL schema to a new one (say phpipv2).
  • Upgrade the phpipv2 schema with the script provided in /database/migrations/sql.
  • Apply further updates to the tables by running the "xxx_update_tables.php" migration scripts - to do this, go in the /database/migrations folder, move all the scripts except the "xxx_update_tables.php" scripts out of the folder, and run php artisan migratefrom the root folder. You may want to restore the /database/migrations folder to its original state afterwards for pulling later updates without confusing git.

Then you need to update the password field of your users. Logins are based on the login and password fields in the actor table only (they are no longer replicated in the MySQL users table). Authorizations will be implemented through the default_role field of the users - set this field to "DBA" to get full permissions in the future.

The passwords are hashed with bcrypt instead of md5, and don't use a user-provided salt. So you need to change all the md5+salt passwords of v1 to bcrypt ones. You can use the password reset functionality of the UI or change the password hashes manually in the actor table with a bcrypt hash. You can generate a bcrypt hash using the command php -r 'echo password_hash("your password",PASSWORD_BCRYPT) . "\n";'.

To fire a quick test, run php artisan serve, and point your browser to http://localhost:8000.

Upgrading

The software is under development, so many changes can occur, sometimes on a daily basis. To stay up to date, dont forget to regularly pull the new commits by running:

  • git pull and
  • composer install

The database structure may be updated too, so you need to apply the new migration scripts in database/migrations. If you have installed phpIP initially with the migration scripts, just run php artisan migrate, which will apply the latest scripts. If you have migrated from v1, you need to manually apply the "xxx_update_tables" migration scripts as explained in the third bullet of "Migrating an existing v1 installation" (you don't need to move the already executed scripts, because the migration process logs them and will only execute each script once, in the order of the time stamps).

Clone this wiki locally