URLExtensions for PHP
- Coded in PHP for using as is, or added to an existing project
- Default behavior as an HTTP POST
- Shipped with a standalone website solution for generating both PDF documents and PNG screen shots of a specified URL or page
- Uses local Windows and Linux binaries shipped with the application (no system dependencies required)
- Can be deployed into a IIS or an Apache Web Server, both are supported
- Supports customization of parameters (page width, margins, etc.)
- Detailed instructions and troubleshooting provided
- Uses latest version of wkhtmltopdf (runing executables is a requirement)
WARNING: if you have a web host, make sure the exec function can be called by a web process, or this will not work!
To check this, an example php file can be created to test this functionality, adding the following content to an empty file with .php extension:
<?php echo exec("ls"); ?>
or for windows
<?php echo exec("dir"); ?>
You will know something is wrong if you get something like this in the web browser:
Warning: exec() has been disabled for security reasons in /home/public_html/test_exec_lin.php on line 10
Current Version: v1.3
Version History
v1.3
- mac os x support (should work at least on snow leopard and mountain lion)
v1.2
- removed xvfb dependency
v1.1
- new documentation (previous documentation very limited)
- fixed Linux/PDF generation issue
v1.0
- Converts PDF and PNG on Windows/Linux using local binaries
Minimum System Requirements
Note: don’t forget to assign write permissions for the output folder (generated-X)
Windows
- IIS
- CGI
- PHP5
Linux
- Apache
- PHP5
Mac OS
- Apache
- PHP5
Actual installation procedure:
Lets say you have a fresh install of an operating system. Here are the minimum requirements you must meet in order to start using this website.
Windows
MINIMUM REQUIREMENTS ON A NEW MACHINE
1) install IIS
2) install PHP 5
3) install FastCGI for IIS (windows component from control panel, programs area)
4) download the deliverable and extract the zip which contains the phpsite folder
5) add read/write permissions to the generated-win folder for everyone
6) add a new website to iis on the location of phpsite
7) add index.php as default document
8 ) add *.php script module entry using FastCGI and php-win.exe to render php files
Linux
MINIMUM REQUIREMENTS ON A NEW MACHINE
1) get apache (sudo apt-get install apache2)
2) get PHP5 (sudo apt-get install php5)
3) extract deliverable zip file that contains the phpsite folder
4) move phpsite over to /var/www (sudo mv phpsite /var/www)
5) add execute permissions to bin-lin AND write permissions for generated-lin for everyone
(Owner, Group and Others, and allow execution) (sudo chmod 777 generated-lin)
6) try http://127.0.0.1/phpsite
Mac OS X Snow Leopard / Mountain Lion
1) install apache
(apachectl start)
2) setup php
(uncomment LoadModule php5_module libexec/apache2/libphp5.so in /etc/apache2/httpd.conf)
3) restart apache (apachectl restart)
- extract phpsite to /Library/WebServer/Documents
4) add permissions to output folder
(chmod 777 generated-mac)
5) go to the bin-mac folder, open the wkhtmltopdf file and copy the app inside it over to the bin-mac folder
6) try http://localhost/phpsite
Possible problematic areas
- Authentication-based sites
- Iframe’d areas
- Flash sites
Additional notes
- Please report any issues or improvement areas
- Please rate if you purchase
- Product tested on Windows7/IIS7, Ubuntu 12/Apache2 and MacOS X Mountain Lion/Apache2