douwen3973 2014-10-27 21:30
浏览 59

Azure网站上的Azure WebJobs中的PHP

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.

  • 写回答

1条回答 默认 最新

  • douzhe9075 2015-04-13 19:08
    关注

    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

    评论

报告相同问题?