We're trying to lift an existing PHP 7.4 app from an internal server running on Windows Server 2012 to an Azure Web App. The PHP app uses OCI8 to connect to an Oracle database. Everything (except the database connection) works fine without the OCI8 extension enabled.
We've followed the guide at https://learn.microsoft.com/en-us/archive/blogs/azureossds/access-oracle-databases-from-azure-web-apps-using-oci8-drivers-with-php as recommended in other Stack Overflow Questions, but whenever the OCI8 extension is enabled we get logless HTTP 500 errors.
The steps we take are:
extension=php_oci8
- all have the same results).The page cannot be displayed because an internal server error has occurred.
We have also tried using the "App Service Logs" in the Azure App Service, and enabling Application Insights, but there was similarly nothing of interest (we could see the HTTP 500 response in the logs, but not any details about what caused it).
The suspicion is that PHP isn't starting, but we aren't sure how to trace that when nothing seems to be logged.
Ultimately, that leads to this being two questions:
Thanks!
UPDATE 2021-08-10
Turns out this issue was due to an incompatibility between the App Service "Composer" extension and OCI8. I'll continue to update this post with progress as we get that enabled, since I assume others will run into this at some point as well.
UPDATE 2021-08-16
Just as a final update, we wound up with an old version of Composer installed (1.6.4). We didn't test all the other versions, but if you run into the same issue 1.6.4 can at least act as a solid baseline.
The Azure Extension's repo doesn't appear to specify a version, so it should grab the latest, but it seems only 1.8.5 gets installed so there might be a bad cache somewhere. TL;DR: If you encounter issues, try manually installing Composer instead of using the Extension.
I did some searching, this one seems like a pretty solid and more recent answer: Does Azure PHP 7 web app have Oracle drivers?.
I think you're probably right that PHP isn’t starting correctly. A few questions:
<?php phpinfo();
, and try to access it while the issue is happening, does oci8 driver load?I built a lab, it took me a little work, but I actually got it running so it seems. I could build an Oracle server and fetch some data to prove it works:
I’d probably follow those steps above and I am sure it can be figured out. It's probably missing one of these steps: