question

StevenSilva-5324 avatar image
0 Votes"
StevenSilva-5324 asked ajkuma-MSFT commented

php 8 in azure app service?

Will azure app services add the latest version of php (PHP 8) in the near future?

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ajkuma-MSFT avatar image
1 Vote"
ajkuma-MSFT answered ValentinWatel-3743 commented

@StevenSilva-5324, Adding to learn2skills response. Yes, the next version of PHP is expected to be PHP 8.0. Official support for PHP 8 will only be available on Linux, as a result of this App Service will only support PHP 8 on Apps Service Linux instances.

For additional information on this topic - PHP on App Service

While there is no concrete ETA to share at this time, you may subscribe to these announcements to stay tuned.

https://azure.microsoft.com/updates/ (Check out upcoming changes to Azure services)
https://azure.microsoft.com/blog/topics/announcements/ (You may subscribe to this announcement)
https://github.com/Azure/app-service-announcements (Follow -app-service-announcements page)


· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Due to official support for PHP 8 will only be available on Linux, what implications would this have if I develop local php applications with PHP 8 on windows but run in production on linux servers?

0 Votes 0 ·
lextm avatar image lextm StevenSilva-5324 ·

You should assume PHP 8 on Windows/IIS is also out of support https://news-web.php.net/php.internals/110907

If you are on Windows 10, then install a Linux distro via WSL and develop your PHP app on that.

0 Votes 0 ·

@StevenSilva-5324, As lextm mentioned you could migrate to Linux.
And as noted - "If you are currently targeting Windows for PHP development, we advise to plan for migrating development to target Linux. After November 28 2022, Linux will be the only OS supported by future versions of PHP and continued feature, quality and security updates."

You can see changes/incompatible features/migration on the official site.

Hope this helps! Thanks for the follow-up.


0 Votes 0 ·

@ajkuma-MSFT
I took at look at the links you shared regarding announcements but I didn't find any news about PHP 8 although it seems, according to the latest comments in this post, that PHP 8 has been released already.
Could you please share by when the announcements as well as the documentation will be provided for the same? It seems according to the latest comments in this post that the migration from Apache to Nginx is not that easy.

Thank you for your support, very appreciated.

0 Votes 0 ·

Hey @ajkuma-MSFT

are there any updates on php8 for azure app service?

As an alternative I would use azure app service for container, but multi-container apps are also in preview (https://azure.microsoft.com/de-de/updates/app-service-multi-container-and-linux-support-for-ase-preview/). So currently I dont see a good option for production ready php8 apps.

Are there any good alternative azure offerings here that we can use instead?

Thank you and many greetings!

0 Votes 0 ·

reanmox-4529 , PHP 8 is expected to be available in a couple months’ time. We do not have a concrete ETA at this time. Please note that the ETA is subject to change due to myriad factors.

Alternatively, Azure offers a number of ways to host your application code. The term compute refers to the hosting model for the computing resources that your application runs on. The flowchart in the doc, will help you to choose a compute service for your application.
https://docs.microsoft.com/azure/architecture/guide/technology-choices/compute-decision-tree#features- This article helps you understand the options and make the right choice for your web application.

2 Votes 2 ·
learn2skills avatar image
1 Vote"
learn2skills answered IvonneMaritzaDuranPrada-8022 commented

Hi @StevenSilva-5324
In Azure web app > app service, current PHP version 7.4 supporting and for the latest PHP 8 in the near future you need to check with the web app product team.

Post your request in the web app product feedback forum you will get a reply from the product team.

If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, I updated php at version 8.0.2, and now I don´t know how install the extension PDO_sqlsrv....help me please

0 Votes 0 ·
StuartCreed-4023 avatar image
0 Votes"
StuartCreed-4023 answered

PHP 8 is now on there.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AlexRyall-9634 avatar image
1 Vote"
AlexRyall-9634 answered VinciusSantana-8224 published

As a warning switching from PHP 7 to PHP 8 it has switched from using Apache to Nginx so any previous rules in .htaccess will be lost and will almost certainly break your app.

There doesn't seem to be any documentation about this switch so can't find a supported way of changing the Nginx config. I did manage this by using sed and a "service nginx reload" in the startup scripts but not very elegant.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I noticed the same thing. Took me I few hours to understand that there's no Apache process running in the built-in container.

We need a supported way to change the Nginx config.

0 Votes 0 ·
ValentinWatel-3743 avatar image
0 Votes"
ValentinWatel-3743 answered ajkuma-MSFT commented

Is there any documentation planned by Microsoft about the changes from Apache to Nginx when using PHP 8.X?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Apologies for the delay! we have a blog on this:
Configuring NGINX Rewrite Rules for Azure App Service blessed images running PHP 8.x

Intro:
Azure App Service on Linux images using PHP 8.x are now bundled with NGINX instead of Apache. The use of .htaccess files will not work for NGINX as these are used for Apache only. This will require the need to setup a custom startup script and modifying the existing NGINX site configuration.

Steps

Navigate to your App Service via the Azure Portal. Under the Development Tools section, select SSH then Go -->.


Modifying the default site config

You will want to make a copy of the existing configuration and place the file inside the /home/site directory.

 cp /etc/nginx/sites-available/default /home/site/default

Once copied, edit the /home/site/default file and update the section below:

server {

 # Section Excluded

 location / {
     index  index.php index.html index.htm hostingstart.html;
     try_files $uri $uri/ /index.php?$args;
 }

 # Section Excluded

}


Create the custom startup script and Updating the application settings



0 Votes 0 ·