question

Christopher-7716 avatar image
0 Votes"
Christopher-7716 asked ryanchill commented

Oryx deployment fails when App Service is used with Composer and PHP 8.0 Runtime Stack

When deploying an Azure App Service application with the PHP 8.0 Runtime Stack, the Oryx deployment fails with the following error:

 Command: oryx build /home/site/repository -o /home/site/wwwroot --platform php --platform-version 8.0 -i /tmp/8d9735c9a363a44 --log-file /tmp/build-debug.log 
    
 Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
    
 You can report issues at https://github.com/Microsoft/Oryx/issues
    
    
    
 Oryx Version: 0.2.20210618.2, Commit: d70100fba618b33e529c149b7d2d5f2c981ebbb1, ReleaseTagName: 20210618.2
    
    
    
 Build Operation ID: |c+0WGRYVibY=.76dc45ff_
    
 Repository Commit : 3c381334fde76a3bd6edbefbf94e5cd4225e3358
    
    
    
 Detecting platforms...
    
 Detected following platforms:
    
   nodejs: 10.22.0
    
   php: 8.0.3
    
    
    
 Using intermediate directory '/tmp/8d9735c9a363a44'.
    
    
    
 Copying files to the intermediate directory...
    
 Done in 3 sec(s).
    
    
    
 Source directory     : /tmp/8d9735c9a363a44
    
 Destination directory: /home/site/wwwroot
    
    
    
 PHP executable: /tmp/oryx/platforms/php/8.0.3/bin/php
    
 Composer archive: /tmp/oryx/platforms/php-composer/2.0.8/composer.phar
    
 php: error while loading shared libraries: libonig.so.4: cannot open shared object file: No such file or directory
    
 Running 'composer install --ignore-platform-reqs --no-interaction'...
    
    
    
 php: error while loading shared libraries: libonig.so.4: cannot open shared object file: No such file or directory\n/opt/Kudu/Scripts/starter.sh oryx build /home/site/repository -o /home/site/wwwroot --platform php --platform-version 8.0 -i /tmp/8d9735c9a363a44 --log-file /tmp/build-debug.log 

I've already opened an issue at the corresponding GitHub project. Has anyone an idea if this can be fixed on our side?


azure-webappsazure-webapps-content-deployment
· 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.


Same issue here. I have a very basic composer.json file containing basic laravel project dependencies and the deploy is failing with this error.

0 Votes 0 ·

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ryanchill commented

Hi @Christopher-7716,

Apologies for this being an answer rather than a comment. I deployed QuickStart | Create a PHP web app in Azure App Service to a PHP 8 instance and didn't run into any issues.

2021-09-10T23:11:38.535548257Z Cannot load Zend OPcache - it was already loaded
2021-09-10T23:11:39.789941059Z   _____                               
2021-09-10T23:11:39.789986759Z   /  _  \ __________ _________   ____  
2021-09-10T23:11:39.789994159Z  /  /_\  \___   /  |  \_  __ \_/ __ \ 
2021-09-10T23:11:39.789998059Z /    |    \/    /|  |  /|  | \/\  ___/ 
2021-09-10T23:11:39.790001859Z \____|__  /_____ \____/ |__|    \___  >
2021-09-10T23:11:39.790005659Z         \/      \/                  \/ 
2021-09-10T23:11:39.790009259Z A P P   S E R V I C E   O N   L I N U X
2021-09-10T23:11:39.790012759Z 
2021-09-10T23:11:39.790015959Z Documentation: http://aka.ms/webapp-linux
2021-09-10T23:11:39.790019159Z PHP quickstart: https://aka.ms/php-qs
2021-09-10T23:11:39.790022459Z PHP version : 8.0.3
2021-09-10T23:11:39.790025559Z Note: Any data outside '/home' is not persisted
2021-09-10T23:11:40.543063020Z Running oryx create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh     -bindPort 8080 -startupCommand 'php-fpm;'
2021-09-10T23:11:41.094042003Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2021-09-10T23:11:41.094068403Z Could not find operation ID in manifest. Generating an operation id...
2021-09-10T23:11:41.094074203Z Build Operation ID: 24f0d2ac-3d6f-4dca-a06d-aac62a0ffb82
2021-09-10T23:11:42.197972581Z Writing output script to '/opt/startup/startup.sh'
2021-09-10T23:11:44.013553473Z Starting nginx: nginx.
2021-09-10T23:11:44.622710340Z Cannot load Zend OPcache - it was already loaded
2021-09-10T23:11:44.813785586Z [10-Sep-2021 23:11:44] NOTICE: fpm is running, pid 41
2021-09-10T23:11:44.823348893Z [10-Sep-2021 23:11:44] NOTICE: ready to handle connections
2021-09-10T23:11:44.862389123Z 127.0.0.1 -  10/Sep/2021:23:11:44 +0000 "GET /index.php" 200
2021-09-10T23:11:44.899374751Z 127.0.0.1 -  10/Sep/2021:23:11:44 +0000 "GET /index.php" 200
2021-09-10T23:11:44.907903958Z 127.0.0.1 -  10/Sep/2021:23:11:44 +0000 "GET /index.php" 200
2021-09-10T23:11:50.191704685Z 127.0.0.1 -  10/Sep/2021:23:11:50 +0000 "GET /index.php" 200
2021-09-10T23:11:55.415926414Z 127.0.0.1 -  10/Sep/2021:23:11:55 +0000 "GET /index.php" 200
2021-09-10T23:11:56.439731573Z 127.0.0.1 -  10/Sep/2021:23:11:56 +0000 "GET /index.php" 200
2021-09-10T23:12:00.644475051Z 127.0.0.1 -  10/Sep/2021:23:12:00 +0000 "GET /index.php" 200
2021-09-10T23:12:05.920874158Z 127.0.0.1 -  10/Sep/2021:23:12:05 +0000 "GET /index.php" 200
2021-09-10T23:12:11.149657153Z 127.0.0.1 -  10/Sep/2021:23:12:11 +0000 "GET /index.php" 200
2021-09-10T23:12:16.468328599Z 127.0.0.1 -  10/Sep/2021:23:12:16 +0000 "GET /index.php" 200


However, I am noticing that a composer.phar was found and oryx is attempting to pull those dependencies. Can you provide your composer.phar so that I can try to repro your issue?

· 8
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.

Hi Ryan, thank you for the response.
I've already added an answer but it does not show up.

I've tried to reduce the composer.json to a minimum and it still does not work, same error as above:

 {
     "name": "laravel/laravel",
     "type": "project",
     "description": "The Laravel Framework.",
     "keywords": [
         "framework",
         "laravel"
     ],
     "license": "MIT",
     "require": {
         "php": "^8.0"
     },
     "require-dev": {
     },
     "config": {
         "optimize-autoloader": true,
         "preferred-install": "dist",
         "sort-packages": true
     },
     "extra": {
         "laravel": {
             "dont-discover": []
         }
     },
     "autoload": {
         "psr-4": {
             "App\\": "app/"
         },
         "classmap": [
             "database/seeds",
             "database/factories"
         ]
     },
     "autoload-dev": {
         "psr-4": {
             "Tests\\": "tests/"
         }
     },
     "minimum-stability": "dev",
     "prefer-stable": true,
     "scripts": {
     }
 }

It's more or less the same issue like https://github.com/heroku/heroku-buildpack-php/issues/396


0 Votes 0 ·

Hi @Christopher-7716 I saw your answer. I was trying to convert it to a comment but something happen, will look into it. I'll look at the GitHub issue you provided. I did want to ask, and forgive my ignorance, you mentioned

I were able to determine that libonig4.so is required by ext-mbstring.

I did not see libonig4.so listed on your composer.phar. Where is that package being pulled in?


0 Votes 0 ·
composer.txt (1.2 KiB)

@ryanchill this is an indirect dependency of ext-mbstring. composer itself requires ext-mbstring. So there is no need to add it in the require or require-dev section. You can easily reproduce the issue by copying the composer.json above (or simply any composer.json) into the Git repository you have mentioned. As soon as composer starts, it will fail.


1 Vote 1 ·
Show more comments