Phani Rao
Phani Rao

Reputation: 165

While installing HTTP_Request2 pacakage(php) in azure raises the issue

I had create a webapp(of php) in azure now i want to install packages HTTP_Request2.While am installing it raises error

enter image description here

Upvotes: 0

Views: 742

Answers (1)

Gary Liu
Gary Liu

Reputation: 13918

On Azure Web Apps, we do not have sufficient permission for file system operations under C: path, we only can read and write files under d:\home path.

To install HTTP_Request2 packages on Azure Web Apps, you can leverage composer.

Please try to run the command: composer require pear/http_request2 and composer update on Kudu Console site or Visual Studio online extension.

Otherwise, if you have already have composer extension on Azure Web Apps, you can config your composer.json on local before deploy to Azure.

You can refer to the answer of How to install composer on app service? for how to enable composer extension on Azure Web Apps.

update

After using composer require pear/http_request2 to install the packages, the composer will generate or update the composer.json file in your root directory of your application, whose contain should be similar with:

{
      "require": {
         "pear/http_request2": "^2.3"
      },      
      "repositories": [
        {
          "type": "pear",
          "url": "http://pear.php.net"
        }
      ],
      "minimum-stability": "dev"
    }

And the packages will be installed in the vendor folder, the pear/http_request2 is in the path of vender/pear/http_request2. At the same time, composer will generate a file autoload.php in the vendor folder.

So, when you use composer to manage our packages, you can use following code to require your pacakges: require_once 'vendor/autoload.php';

Upvotes: 0

Related Questions