Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Run PHP Webjob on Azure App Service (Windows)

When you deploy a webjob to run PHP program, there are few items to verify and help to understand the Php Runtime for webjobs.

1. How to create a PHP webjob
- Execute a .php file
- Create batch to execute .php file
- Create shell to execute .php file

2. PHP runtime for webjob is difference from the PHP runtime for webapp, to verify the PHP runtime, you can trigger a webjob export phpinfo, or run the following command from Kudu 'Debug console',

   php -i > phpinfo.txt

3. From phpinfo.txt (if you run a phpinfo from webjob, check the output log),

- find the php.ini location
Loaded Configuration File => D:Program Files (x86)PHPv7.1php.ini

- find PHP_INI_SCAN_DIR
Scan this dir for additional .ini files => d:homesiteini
Additional .ini files parsed => d:homesiteinisettings.ini

You can define PHP_INI_SCAN_DIR in App Settings:

- find if Php Error Log is enabled
log_errors => Off => Off

- find PHP error log file location (you can modify this location in additional .ini file defined in PHP_INI_SCAN_DIR, e.g. d:homesiteinisettings.ini)
error_log => D:Windowstempphp71_errors.log => d:Windowstempphp71_errors.log

- Enable PHP extensions
Check from Kudu, default installed PHP extensions are listed in D:Program Files (x86)PHPv7.xext
If you use PHP 7.x 64-bit, check from D:Program FilesPHPv7.xext
To enable an extension in this list, add it in additional .ini file, for example,

extension=php_ldap.dll

- Install PHP extensions
If the PHP extension is not available from default extension list, download the matching version, for example, you can put it in d:homesiteext, then add the extension in additional .ini file, e.g.

extension="D:homesiteextphp_redis.dll"

Share the post

Run PHP Webjob on Azure App Service (Windows)

×

Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription

×