Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Friday, April 21, 2017

Setup PHP with PostgreSQL connection in Windows

On a Windows server, configured with Apache, adding the following line to httpd.conf to load libpq.dll can save you a lot of time :

LoadFile "C:/Program Files/PostgreSQL/9.1/bin/libpq.dll"

Then edit the php.ini file (in folder : C:\xampp\php). Enable this lines:
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll


Environment:

  • Windows 7
  • XAMPP
  • XAMPP Control panel v3.2.1
  • PostgreSQL 9.1


Reference:

Tuesday, May 20, 2014

Using DOMPDF in Yii


  1. Download dompdf : https://code.google.com/p/dompdf/
  2. Extract and copy dompdf folder to protected\vendor
  3. Add the following command to the top of controller that will using dompdf
Yii::import('application.vendor.*');
require_once('dompdf/dompdf_config.inc.php');
Yii::registerAutoloader('DOMPDF_autoload');
  1. Then we should can used like this
 public function actionDompdf() {
...
  $pdf = new DOMPDF();
...
 }

I think we can use the same way to including/import another library