Skip to content
Thulana Kannangara edited this page Nov 2, 2017 · 6 revisions

Development Environment Guide

Web Containers

How to restart apache server

  • Service httpd restart - restart server
  • Service httpd status - check server status

Add new Vhost configurations

Users can add new virtualhost configurations for the dev environment.

Location of the configurations - /etc/httpd/sites-available/

Example conf file:

<VirtualHost *:443>
  ServerAdmin webmaster@orangehrm.com
  VirtualDocumentRoot /var/www/html/OHRMStandalone/OPENSOURCE/%0/symfony/web

  ErrorLog /etc/httpd/logs/error_log
  CustomLog /etc/httpd/logs/access_log common
  DocumentRoot /var/www/html/OHRMStandalone/OPENSOURCE/
  ServerName orangehrm.com
  ServerAlias *opensource-phantom.orangehrm.com
  <Directory /var/www/html/OHRMStandalone/OPENSOURCE/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

</VirtualHost>

Add vhost file to sites-available folder


Login to docker image :

  • Create symlink to sites-enabled folder
    Eg: sudo ln -s /etc/httpd/sites-available/example.com.conf /etc/httpd/sites-enabled/example.com.conf
  • Restart apache service service httpd restart

Running PHPUnit tests

  • PHPUnit 3.7 - phpunit3
  • PHPUnit 5.7 - phpunit

MySQL Containers

Connect to MySQL database

  • Within web container - mysql -h<db55/db57/db101> -uroot -p1234
  • From local machine - mysql -h<10.5.0.5/10.5.0.6/10.5.0.7> -uroot -p1234
  • From phpmyadmin - URL :http://localhost:9092

OpenLDAP server Container

Connect to Ldap database

OrangeHRM application Ldap configuration

  • LDAP server address : 10.5.0.22
  • LDAP ports
    • Ldap - 389 Anonymous binding - enabled
    • Sldap - 636

Dependency management

  • yum is the default dependency manager for centos. Eg: yum install <package_name>

  • update system - yum update

Profiling with Xhprof/Xhgui

  • Xhprof and Xhgui is available for profiling the application and modeling the details

  • Use below command to enable xhgui

    docker-compose -f docker-compose.yml -f docker-compose.xhgui.yml up -d

Profiling application:

  1. Web: Need to add the following to apache virtual host setting

php_admin_value auto_prepend_file "/var/www/xhgui/external/header.php" (Note: This can be done by the auto_prepend_file setting in php.ini as well)

  1. CLI:

Add a require to the script: require '/var/www/xhgui/external/header.php'; or alternatively: use the -d flag when running php:

php -d auto_prepend_file=/var/www/xhgui/external/header.php symfony o:publish-assets