简体   繁体   中英

How do I execute an index.php page in an Azure App Service?

I've created an Azure App Service and I've set the PHP version to 5.6 (though I've experimented with different versions and it doesn't seem to matter).

在此处输入图片说明 I've deployed the world's simplest PHP script in index.php (via a git local repo method):

<?php

// Show all information, defaults to INFO_ALL
echo "hello";
?>

When I access the URL for my App Service, the page is blank and the view source is just the script contents. Which is to say that it's not being processed and rendered as PHP.

I know PHP is doing something . I know this because if I turn the PHP version off in the App Service settings, I get an error message "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." when accessing the page. So it only serves .php pages when PHP is on. That's sensible, except it's not actually processing the script.

I'm sure I'm doing something obviously wrong, but I cannot figure out what it is.

You can add a index.php in the Default documents section in app Settings of your Azure Web App, to approach your requirement.

在此处输入图片说明

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