0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHP3+ HTTP_Request2

0
Posted at

というか、プラグインのインストールに手こずった。
ポイントは、"/var/www/html/my_app"ディレクトリでインストール作業しなさいってことだった。

参考

Dockerfile

FROM amazonlinux:2

# こんなにインストールいらないかもしれない
RUN yum update -y && \
    yum clean all && \
    amazon-linux-extras install php7.3  && \
    yum install -y wget zip unzip tar httpd && \
    yum install -y php php-gd php-mbstring php-xml php-pecl-zip php-pgsql php-pear php-intl && \
    yum clean all

RUN curl -s http://getcomposer.org/installer | php && \
    mv composer.phar /usr/local/bin/composer
WORKDIR /var/www/html
RUN composer create-project --prefer-dist --no-dev cakephp/app:3.8.* my_app

# http_request2
WORKDIR /var/www/html/my_app
RUN composer require pear/http_request2:2.3.*

CMD ["/usr/sbin/httpd","-D","FOREGROUND"]

EXPOSE 80

使用

/var/www/html/my_app/src/Controller/ExampleController.php

<?php
namespace App\Controller;

use App\Controller\AppController;
use HTTP_Request2;

class ExampleController extends AppController {
        /**
         *
         */
        public function test() {
            ・・・
            $req = new HTTP_Request2(・・・);
            ・・・
        }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?