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:
- Starting with OCI8 disabled, the app loads fine but can't run any database calls. Database call errors are recorded in the logs.
- Edit the D:\home\site\ini\extensions.ini file to enable OCI8 (we've tried multiple variations - full path, 32 bit, 64 bit, extension name only e.g.
extension=php_oci8
- all have the same results). - Restart the app
- Refresh the page - result is status code 500, with a plain white screen reading
The page cannot be displayed because an internal server error has occurred.
- Check everything under D:\home\LogFiles, including php_errors.log, eventlog.xml, and /http/RawLogs. eventlog.xml shows the server reboot, nothing else is recorded after that.
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:
- Is there perhaps a different way to enable logs in the Azure App Service, or a log location I might be missing?
- Is there an updated guide available for running a PHP app with OCI8 on Azure App Service? The guide above is 5+ years old, and at a minimum the versions of everything listed in it appear to be outdated. I suspect the Azure App Service has updated in a way that might be blocking us too.
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.