How to use PHPCG on a localhost and a remote server
PHP CRUD Tutorial

PHP CRUD Generator can be used according to your convenience directly on your production server, or from your local server by synchronizing the configuration & Bootstrap admin dashboard files.


Whatever your choice, you must register your license on each server on which you use PHPCG.
Registering the license generates a table user_data in your database. The table user_data must not be synchronized from one server to another.


Working straight on your production server [Recommended]

If you use the generator directly on your production server you don't need to synchronize your conf. & dashboard admin files. That's why this is the recommended method: there is no risk of synchronization errors.

Here's how to proceed:

  1. 1 Upload the required folders on your server
  2. 2 Open the generator (generator/generator.php) in your browser and start to build the admin panel
  3. 3 You can protect the generator access with a login and password:
    1. Open the General Settings from the Generator page
    2. Enable Lock the Generator and validate
    3. The generator is protected. The login is your email and the pasword is your purchase code.

You will then have to install the authentication module of the admin panel.

important Do not install it before having generated all the views (READ lists) of your admin dashboard.
The authentication module needs to know the tables used in the admin so that you can assign them rights (user profiles).

Working on your local server and synchronizing with your production server

  1. 1 Open the generator in your browser and start to build the admin panel on your localhost
  2. 2 Move your installation from localhost to the production server
  3. 3 When you create your views (READ lists), forms, some files are created or updated in the admin directory.
    You just have to upload these files on your production server.
    When you edit the configuration (General Settings), conf/user-conf.json is updated.

What you need to know:

  • You don't need to upload the generator folder on your production server.
  • The database connection file is /class/phpformbuilder/database/db-connect.php. The connection settings were written in this file during installation. They are specific to each server: don't synchronize this file..
  • The filters and select options of each table are stored in admin/crud-data in JSON format.
  • The READ lists use PHP classes in admin/class/ and TWIG templates in admin/templates/.
  • The forms are in admin/inc/forms/
  • The navigation bar is in admin/crud-data/nav-data.json

PHP CRUD tutorial main page

subscribe