简体   繁体   中英

PHP in Azure WebJobs on Azure Website

I've written a powershell script that basically calls php %WEBROOT%\\dir\\ and set it to run as as WebJob in Azure - this is on an Azure Website.

The problem I am having is it does not pickup the .user.ini file that is configured (and working) on the Website. I've been playing around with powershell in kudu and am at wits end on how to get this to work.

Is there anyway to launch php in a away that is can append a user.ini file to the standard php.ini file? Otherwise my only solution I can think of so far is to read the entire php.ini in D:\\Program Files\\xxx, copy it, append to it and execute php with my modified version. This isn't an ideal solution and I'm trying to get around it if possible.

Alternatively, the other way around it is to declare using ini_set() the variables I want to change at run time but the problem with this not all my vars are set - in particularly error_reporting. If someone can help me work out a way to turn off E_STRICT & E_NOTICE it would also solve my problem. I've tried error_reporting(0) and all the different way but it completely ignores them - it works fine with date.timezone, include_path, etc.

Config options can be set with the -d parameter upon calling the PHP executable. I used it to include the mongo extension, which is not included by default. My job is a .bat file with the line below.

"%ProgramFiles%\PHP\v5.6\php.exe" -dextension=D:\home\site\wwwroot\bin\php_mongo.dll D:\home\site\cli\ascript.php

See the docs here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM