アフィリエイト広告を利用しています
ファン
検索
<< 2020年05月 >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
最新記事
写真ギャラリー
最新コメント
タグクラウド
カテゴリーアーカイブ
月別アーカイブ
プロフィール
日別アーカイブ

広告

この広告は30日以上更新がないブログに表示されております。
新規記事の投稿を行うことで、非表示にすることが可能です。
posted by fanblog

2020年05月02日

mysql5.7 wordpress設定

Last login: Sat May 2 16:27:13 on ttys006
You have new mail.
cMacBook-Pro-3:~ yusuke$ cd Centos7/
MacBook-Pro-3:Centos7 yusuke$ vagrant ssh
Last login: Sat May 2 07:04:18 2020 from 10.0.2.2
[vagrant@localhost ~]$ sudo su -
最終ログイン: 2020/05/02 (土) 07:04:30 UTC日時 pts/0
server {
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
index.php
[root@localhost html]# rm index.php
rm: remove regular file ‘index.php’? y
[root@localhost html]# wget https://ja.wordpress.org/latest-ja.tar.gz
--2020-05-02 07:28:54-- https://ja.wordpress.org/latest-ja.tar.gz
Resolving ja.wordpress.org (ja.wordpress.org)... 198.143.164.252
Connecting to ja.wordpress.org (ja.wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12960979 (12M) [application/octet-stream]
Saving to: ‘latest-ja.tar.gz’

100%[======================================>] 12,960,979 5.74MB/s in 2.2s

2020-05-02 07:28:57 (5.74 MB/s) - ‘latest-ja.tar.gz’ saved [12960979/12960979]

[root@localhost html]# tar xfz latest-ja.tar.gz
[root@localhost html]# chown -R nginx. wordpress
[root@localhost html]# mv wordpress sample.com
[root@localhost html]# cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf_bkup20200502wordpressconfig
[root@localhost html]# vim /etc/nginx/conf.d/default.conf
[root@localhost html]# systemctl restart nginx
[root@localhost html]# sudo rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
warning: /var/tmp/rpm-tmp.JW4TwL: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql57-community-release-el7-7 ################################# [100%]
[root@localhost html]# sudo yum info mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cat.net
* epel: ftp.iij.ad.jp
* extras: mirrors.cat.net
* remi-safe: ftp.riken.jp
* updates: mirrors.cat.net
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql57-community | 2.5 kB 00:00
(1/3): mysql-connectors-community/x86_64/primary_db | 57 kB 00:00
(2/3): mysql-tools-community/x86_64/primary_db | 72 kB 00:00
(3/3): mysql57-community/x86_64/primary_db | 213 kB 00:00
Available Packages
Name : mysql-community-server
Arch : x86_64
Version : 5.7.30
Release : 1.el7
Size : 173 M
Repo : mysql57-community/x86_64
Summary : A very fast and reliable SQL database server
URL : http://www.mysql.com/
License : Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights
: reserved. Under GPLv2 license as shown in the Description field.
Description : The MySQL(TM) software delivers a very fast, multi-threaded,
: multi-user, and robust SQL (Structured Query Language) database
: server. MySQL Server is intended for mission-critical, heavy-load
: production systems as well as for embedding into mass-deployed
: software. MySQL is a trademark of Oracle and/or its affiliates
:
: The MySQL software has Dual Licensing, which means you can use the
: MySQL software free of charge under the GNU General Public License
: (http://www.gnu.org/licenses/). You can also purchase commercial
: MySQL licenses from Oracle and/or its affiliates if you do not
: wish to be bound by the terms of the GPL. See the chapter
: "Licensing and Support" in the manual for further info.
:
: The MySQL web site (http://www.mysql.com/) provides the latest
: news and information about the MySQL software. Also please see
: the documentation and the manual for more information.
:
: This package includes the MySQL server binary as well as related
: utilities to run and administer a MySQL server.

[root@localhost html]# sudo yum -y install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cat.net
* epel: nrt.edge.kernel.org
* extras: mirrors.cat.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.cat.net
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.30-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.30-1.el7 for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: net-tools for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package mysql-community-client.x86_64 0:5.7.30-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.30-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.30-1.el7 will be installed
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.65-1.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.30-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.30-1.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-community-libs x86_64 5.7.30-1.el7 mysql57-community 2.3 M
replacing mariadb-libs.x86_64 1:5.5.65-1.el7
mysql-community-libs-compat
x86_64 5.7.30-1.el7 mysql57-community 1.2 M
replacing mariadb-libs.x86_64 1:5.5.65-1.el7
mysql-community-server x86_64 5.7.30-1.el7 mysql57-community 173 M
Installing for dependencies:
libaio x86_64 0.3.109-13.el7 base 24 k
mysql-community-client x86_64 5.7.30-1.el7 mysql57-community 25 M
mysql-community-common x86_64 5.7.30-1.el7 mysql57-community 311 k
net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k

Transaction Summary
================================================================================
Install 3 Packages (+4 Dependent packages)

Total download size: 203 M
Downloading packages:
(1/7): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:01
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.30-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.7.30-1.el7.x86_64.rpm is not installed
(2/7): mysql-community-common-5.7.30-1.el7.x86_64.rpm | 311 kB 00:01
(3/7): mysql-community-libs-5.7.30-1.el7.x86_64.rpm | 2.3 MB 00:00
(4/7): mysql-community-libs-compat-5.7.30-1.el7.x86_64.rpm | 1.2 MB 00:00
(5/7): net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00
(6/7): mysql-community-client-5.7.30-1.el7.x86_64.rpm | 25 MB 00:02
(7/7): mysql-community-server-5.7.30-1.el7.x86_64.rpm | 173 MB 00:04
--------------------------------------------------------------------------------
Total 29 MB/s | 203 MB 00:06
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering "
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package : mysql57-community-release-el7-7.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.7.30-1.el7.x86_64 1/8
Installing : mysql-community-libs-5.7.30-1.el7.x86_64 2/8
Installing : mysql-community-client-5.7.30-1.el7.x86_64 3/8
Installing : libaio-0.3.109-13.el7.x86_64 4/8
Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 5/8
Installing : mysql-community-server-5.7.30-1.el7.x86_64 6/8
Installing : mysql-community-libs-compat-5.7.30-1.el7.x86_64 7/8
Erasing : 1:mariadb-libs-5.5.65-1.el7.x86_64 8/8
Verifying : mysql-community-server-5.7.30-1.el7.x86_64 1/8
Verifying : mysql-community-libs-5.7.30-1.el7.x86_64 2/8
Verifying : mysql-community-client-5.7.30-1.el7.x86_64 3/8
Verifying : mysql-community-libs-compat-5.7.30-1.el7.x86_64 4/8
Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 5/8
Verifying : mysql-community-common-5.7.30-1.el7.x86_64 6/8
Verifying : libaio-0.3.109-13.el7.x86_64 7/8
Verifying : 1:mariadb-libs-5.5.65-1.el7.x86_64 8/8

Installed:
mysql-community-libs.x86_64 0:5.7.30-1.el7
mysql-community-libs-compat.x86_64 0:5.7.30-1.el7
mysql-community-server.x86_64 0:5.7.30-1.el7

Dependency Installed:
libaio.x86_64 0:0.3.109-13.el7
mysql-community-client.x86_64 0:5.7.30-1.el7
mysql-community-common.x86_64 0:5.7.30-1.el7
net-tools.x86_64 0:2.0-0.25.20131004git.el7

Replaced:
mariadb-libs.x86_64 1:5.5.65-1.el7

Complete!
[root@localhost html]# mysql --version
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
[root@localhost html]# sudo systemctl start mysqld
[root@localhost html]# cat /var/log/mysqld.log | grep password
2020-05-02T07:37:47.451569Z 1 [Note] A temporary password is generated for root@localhost: <:6tGiSLg2(A [root@localhost html]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. # Remove leading # and set to the amount of RAM for the most important data Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done! [root@localhost html]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.30 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> exit
Bye
[root@localhost html]# cp /etc/my.cnf /etc/my.cnf_backup20200502changepasswordLimigted
[root@localhost html]# vi /etc/my.cnf
[root@localhost html]# sudo systemctl restart mysqld
[root@localhost html]# sudo systemctl enable mysqld
[root@localhost html]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create wordpress
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wordpress' at line 1
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on wordpress.* to root@localhost identified by '<:6tGiSLg2(B'; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> show databases;
+--------------------+
| Database |
* @package WordPress
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
5 rows in set (0.01 sec)

mysql> exit
Bye
[root@localhost html]# id root
uid=0(root) gid=0(root) groups=0(root)
[root@localhost html]# cd sample.com
[root@localhost sample.com]# ls
index.php wp-blog-header.php wp-includes wp-settings.php
license.txt wp-comments-post.php wp-links-opml.php wp-signup.php
readme.html wp-config-sample.php wp-load.php wp-trackback.php
wp-activate.php wp-content wp-login.php xmlrpc.php
wp-admin wp-cron.php wp-mail.php
[root@localhost sample.com]# cp wp-config-sample.php wp-config.php
[root@localhost sample.com]# chown -R nginx:nginx *
[root@localhost sample.com]# chmod -R g+w *
[root@localhost sample.com]# vi wp-config.php
[root@localhost sample.com]# ls
index.php wp-blog-header.php wp-cron.php wp-mail.php
license.txt wp-comments-post.php wp-includes wp-settings.php
readme.html wp-config.php wp-links-opml.php wp-signup.php
wp-activate.php wp-config-sample.php wp-load.php wp-trackback.php
wp-admin wp-content wp-login.php xmlrpc.php
[root@localhost sample.com]# cd ..
[root@localhost html]# ls
latest-ja.tar.gz sample.com
[root@localhost html]# rm latest-ja.tar.gz
rm: remove regular file ‘latest-ja.tar.gz’? y
[root@localhost html]# cd sample.com/
[root@localhost sample.com]# cat wp-config-sample.php

2020年05月01日

php-fpmのインストール(sockets通信)

ルートユーザに変更する

$ sudo su -
yumのアップデート

$ yum update
EPELリポジトリの追加

$ yum -y install epel-release
remiリポジトリの追加

$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
 
使いそうなものをインストールしておく
vimのインストール (ついvimって打ってしまうので入れとく)

$ yum -y install vim
wgetのインストール (wordpressインストールとかに使う)

$ yum -y install wget

自動アップデートの設定

$ yum install yum-cron

$ vim /etc/yum/yum-cron.conf
Vagrantfile内のapply_updatesをnoからyesに修正する

# Whether updates should be applied when they are available. Note
# that download_updates must also be yes for the update to be applied.
apply_updates = yes
nginxの状態確認(起動前)

$ systemctl status nginx
Active: inactive (dead)
nginxの起動

$ systemctl start nginx
nginxの状態確認(起動後)

$ systemctl status nginx
Active: active (running)
サーバ再起動時にnginxが自動起動するように設定するようにする

$ systemctl enable nginx.service

ブラウザでアクセス(vagrantfileでコメントアウトを外したip)
http://192.168.33.10/

welcome to nginx!

nginxの設定

$ vim /etc/nginx/conf.d/default.conf


以下を編集する
(〜.confのファイルが読み込まれるらしい。本やブログごとに名前が違って紛らわしいが、だぶんそういうこと。)

server {
listen 80;
server_name localhost;
root /var/www/html/;
charset UTF-8;
access_log /var/log/nginx/sample.com.access.log main;
error_log /var/log/nginx/sample.com.error.log;

location / {
index index.php index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}


nginxの再起動

$ systemctl restart nginx
 
phpとphp-fpmのインストール

$ yum -y install --enablerepo=epel,remi,remi-php74 php php-mbstring php-pdo php-mysqlnd php-fpm
PHPのバージョン確認


$ php -v
PHP 7.4.5


php-confの設定を行う

$ vim /etc/php-fpm.d/www.conf
それぞれの行を修正する

修正前
listen = 127.0.0.1:9000
修正後
listen = /var/run/php-fpm/php-fpm.sock

修正前
user = apache
修正後
user = nginx

修正前
group = apache
修正後
group = nginx

修正前
;listen.owner = nobody
;listen.group = nobody
修正後
listen.owner = nginx
listen.group = nginx
php-fpmの起動

$ systemctl start php-fpm
php-fpmの状態確認

$ systemctl status php-fpm
サーバ再起動時にphp-fpmが自動起動するように設定するようにする

$ systemctl enable php-fpm
 

とりあえず、phpが使えるか確認してみる。

$ cd /var/www/html
$ vim index.php
みんな大好き hello world! 以下を記述して保存する。

新規ユーザーでのssh鍵認証 ssh -i 秘密鍵 username@サーバ(192.168.33.10 )

vagrant sshでログインし下記コマンドでrootにスイッチ
sudo su -

パスワード認証をYesにする
[root@sv11-centos74 ~]# vi /etc/ssh/sshd_config
PasswordAuthentication yes
[root@sv11-centos74 ~]# systemctl restart sshd

サーバからログアウトする。
ローカルPCで秘密鍵と公開鍵を設定する
ssh-keygen -t rsa -b 4096 -C "hoge@example.com" -f ~/.ssh/username_id_rsa

パスワードを使用して新規作成ユーザでログイン
ssh sampleuser@192.168.33.10

sshフォルダを作成
[vagrant@localhost ~]$ mkdir .ssh
[vagrant@localhost ~]$ chmod 700 .ssh

公開鍵を送信
scp /home/[user名]/.ssh/id_rsa.pub [リモートユーザー]@[リモートサーバーのホスト名]:~/.ssh

再度パスワードでログイン

sshフォルダへ移動し、authorized_keyに名前を変更
[vagrant@localhost .ssh]$ mv /id_rsa.pub authorized_keys
権限を変更
[vagrant@localhost .ssh]$ chmod 600 authorized_keys

ログアウトしてsshでログインしてみる
ssh -i id_rsa menta@192.168.33.10

パスワード認証をNoに戻す
[root@sv11-centos74 ~]# vi /etc/ssh/sshd_config
PasswordAuthentication no
[root@sv11-centos74 ~]# systemctl restart sshd

Linuxにユーザを追加する

ユーザを追加
useradd sampleuser

パスワードを設定
passwd sampleuser


sudo実行を許可するためにグループ追加
usermod -aG wheel sampleuser

参考URL
https://qiita.com/Esfahan/items/a159753d156d23baf180

CentOS7にcronを設定

以下の形でインストールしたイメージにはCronは初期から入っている
vagrant init CentOS/7
ルートユーザになり
sudo su -

以下のコマンドでcron起動
systemctl start crond.service

再起動のコマンド。
systemctl restart crond.service

自動起動の設定
systemctl enable crond.service

cron設定したユーザにて以下のコマンドを実行
crontab -e

* * * * * [実行したいファイルパス]
分 時 日 月 曜日の順に設定する

対象ファイルには実行権限を付与すること
chmod +x [ファイルパス]

chmod +x /var/backup/sh/mysql-backup.sh

権限が付与されていることを確認する
ls -al /var/backup/sh/mysql-backup.sh

xがついてればOK
-rwxr-xr-x. 1 root root 951 May 1 12:41 /var/backup/sh/mysql-backup.sh


参考
https://time4vps.ysklog.net/cron.html

nginxを監視するシェルスクリプト

$ vim process_check.sh

#! /bin/bash

#監視するプロセス名を定義する
PROCESS_NAME=nginx

#監視するプロセスが何個起動しているかカウントする
count=`pgrep $PROCESS_NAME | wc -l`
# pgrep プロセスIDを表示
# wc -l 行数を取得

#監視するプロセスが0個場合に、処理を分岐する
if [ $count = 0 ]; then

#0個場合は、サービスが停止しているので起動する
echo "$PROCESS_NAME Down"
echo "$PROCESS_NAME Start"

systemctl start nginx
else
echo "$PROCESS_NAME OK"
fi


$ sudo chmod +x process_check.sh

vagrantでCentOS7とnginx環境を構築する

以下のコマンドを入力しvagrant環境を構築

mkdir -p ~/vagrant/
cd ~/vagrant/
vagrant box add centos/7
vagrant init centos/7
vim Vagrantfile
config.vm.network "private_network", ip: "192.168.33.10" #追加
vagrant up

vagrantに接続しnginxをインストール
vagrant ssh

rootユーザになる
sudo su -

vi /etc/yum.repos.d/nginx.repo
nginx.reposを作成

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

コピペ元
https://www.nginx.com/resources/wiki/start/topics/tutorials/install/

nginxインストール
sudo yum install nginx

Is this ok [y/d/N]: y

nginx起動
sudo systemctl start nginx

ブラウザに192.168.33.10でアクセス
open http://192.168.33.10/index.html

2020年04月28日

Docker+Laravel(PHP7.4)のテスト時にError: Call to undefined function Illuminate\Http\Testing\imagetruecolor()

Laravel(PHP7.4)とDockerにてアップロードのテストを実行したらタイトルのエラーが発生。
調べてみると、PHPにGDのライブラリを入れていない場合に発生するエラーのよう。
とりあえず、DockerfileのPHPの箇所に以下のようにGDを追加。(GDを入れる際にはいくつか他のライブラリを入れる必要があるっぽい)
★マークが追加した箇所で、一番気をつけないといけないのは、以下の箇所。
& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
PHP7.4から引数の書き方が変わっている模様

PHP7.3以前は以下のように書くみたいです。
--with-freetype-dirとなっていてPHP7,4では-dirが削除されています(jpegも同様)
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \


----- 参考Dockerfileの中身
FROM php:7.4.1-fpm

COPY install-composer.sh /
RUN apt-get update \
&& apt-get install -y wget git unzip libpq-dev \
★# for gd
★libfreetype6-dev \
★libjpeg62-turbo-dev \
★libpng-dev \
★libwebp-dev \
★libxpm-dev \
&& : 'Install Node.js' \
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs \
&& : 'Install PHP Extensions' \
★&& docker-php-ext-install -j$(nproc) pdo_pgsql iconv\
★ && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
★ && docker-php-ext-install -j$(nproc) gd \
&& : 'Install Composer' \
&& chmod 755 /install-composer.sh \
&& /install-composer.sh \
&& mv composer.phar /usr/local/bin/composer

WORKDIR /var/www/html/vuesplash

---------------


上記更新後に
docker-compose up --build -d
でコンテナを再ビルドして、テストを再実行したところエラーが消えました!


参考サイト
https://www.nyamucoro.com/entry/2018/10/29/232724

https://tanaken.me/web/770/

https://qiita.com/qvtec/items/443362e7e4f717c07c79

https://uiuifree.com/blog/develop/docker-gd-php-7/

laravel phpunit実行時に419error

LaravelとVueのアプリケーションにて、下記エラーが発生。
Expected status code 200 but received 419.
├ Failed asserting that 200 is identical to 419

下記コマンド実行後に再度実行すると解決した。
php artisan config:clear

参考URL
https://stackoverflow.com/questions/46325790/phpunit-expected-status-code-200-but-received-419-with-laravel
×

この広告は30日以上新しい記事の更新がないブログに表示されております。