SOY Gallery で画像をアップロードしようとするとエラーが発生する 投稿する

投稿者:オフィスニコ  投稿日時:2023-04-30 15:41:17
いつもお世話になっております。

SOYGalleryで画像をアップロードしようとしますと、下記のエラーが発生します。
SOYCMSのバージョンは3.11.32。SOYGalleryのバージョンは2.0.1です。

Warning: move_uploaded_file(/home/****/****/public_html/home/****/****/public_html/GalleryImage/daimonji_gallery/32647_24739_40272.jpg): failed to open stream: No such file or directory in /home/****/****/public_html/****/app/webapp/gallery/src/logic/UploadLogic.class.php on line 75

Warning: move_uploaded_file(): Unable to move '/tmp/phpwiz0R7' to '/home/****/****/public_html/home/****/****/public_html/GalleryImage/daimonji_gallery/32647_24739_40272.jpg' in /home/****/****/public_html/****/app/webapp/gallery/src/logic/UploadLogic.class.php on line 75

Fatal error: Uncaught TypeError: Argument 1 passed to InsertLogic::insert() must be of the type string, null given, called in /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php on line 31 and defined in /home/****/****/public_html/****/app/webapp/gallery/src/logic/InsertLogic.class.php:9 Stack trace: #0 /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php(31): InsertLogic->insert(NULL, 1) #1 /home/****/****/public_html/****/common/lib/soy2_build.php(8180): IndexPage->doPost() #2 /home/****/****/public_html/****/common/lib/soy2_build.php(8167): WebPage->prepare() #3 /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php(59): WebPage->__construct() #4 /home/****/****/public_html/****/common/lib/soy2_build.php(5548): IndexPage->__construct(Array) #5 /home/****/****/public_html/dc in /home/****/****/public_html/****/app/webapp/gallery/src/logic/InsertLogic.class.php on line 9

【エラーメッセージ】
Uncaught TypeError: Argument 1 passed to InsertLogic::insert() must be of the type string, null given, called in /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php on line 31 and defined in /home/****/****/public_html/****/app/webapp/gallery/src/logic/InsertLogic.class.php:9 Stack trace: #0 /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php(31): InsertLogic->insert(NULL, 1) #1 /home/****/****/public_html/****/common/lib/soy2_build.php(8180): IndexPage->doPost() #2 /home/****/****/public_html/****/common/lib/soy2_build.php(8167): WebPage->prepare() #3 /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php(59): WebPage->__construct() #4 /home/****/****/public_html/****/common/lib/soy2_build.php(5548): IndexPage->__construct(Array) #5 /home/****/****/public_html/dc

【レポート】
DETECT DATE: 2023-04-30T15:34:38+09:00

MESSAGE: Uncaught TypeError: Argument 1 passed to InsertLogic::insert() must be of the type string, null given, called in /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php on line 31 and defined in /home/****/****/public_html/****/app/webapp/gallery/src/logic/InsertLogic.class.php:9
Stack trace:
#0 /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php(31): InsertLogic->insert(NULL, 1)
#1 /home/****/****/public_html/****/common/lib/soy2_build.php(8180): IndexPage->doPost()
#2 /home/****/****/public_html/****/common/lib/soy2_build.php(8167): WebPage->prepare()
#3 /home/****/****/public_html/****/app/webapp/gallery/pages/List/IndexPage.class.php(59): WebPage->__construct()
#4 /home/****/****/public_html/****/common/lib/soy2_build.php(5548): IndexPage->__construct(Array)
#5 /home/****/****/public_html/dc
EXCEPTION TYPE: ErrorException
LOCATION: /****/app/webapp/gallery/src/logic/InsertLogic.class.php (9)

SOY CMS Version: 3.11.32
SOY CMS Build Date: 2023-04-25T13:49:23+09:00
SOY CMS DB Type: sqlite
SOY2RootDir: /home/****/****/public_html/****/app/webapp/gallery/src/
SOY2_DOCUMENT_ROOT: undefined


STACK TRACE
-----------------------
0:soycms_shutdown

()

Server Environment
PHP Version: 7.4.33

PHP SAPI NAME: fpm-fcgi
PHP SAFE MODE: No
SHORT_OPEN_TAG: Yes

MEMORY_LIMIT: 1G Bytes
Memory Usage: 1,280,000 Bytes
2,097,152 Bytes (Real)
1,378,560 Bytes (Peak)
2,097,152 Bytes (Peak, Real)

MAX_EXECUTION_TIME: 180 sec.
POST_MAX_SIZE: 1G Bytes
UPLOAD_MAX_FILESIZE: 1G Bytes

mb_string: Yes
PDO: Yes
PDO_SQLite: Yes
PDO_MySQL: Yes
Standard PHP Library: Yes
SimpleXML: Yes
JSON: Yes
Services_JSON: No
ZIP: Yes
ZipArchive: Yes
Archive_Zip: No
OpenSSL: Yes
HASH: Yes
GD: Yes

Module/CGI CGI
Rewrite Unknown

USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
REQUEST_URI: /****/app/index.php/gallery/List/1
SCRIPT_NAME: /****/app/index.php
PATH_INFO: /gallery/List/1
QUERY_STRING:

DOCUMENT_ROOT: /home/****/****/public_html
SCRIPT_FILENAME: /home/****/****/public_html/****/app/index.php

SOY CMS Options
SOYCMS_ALLOWED_EXTENSIONS: undefined
SOYCMS_ALLOW_PHP_SCRIPT: undefined
SOYCMS_SKIP_MOBILE_RESIZE: undefined
SOYCMS_BLOCK_LIST: undefined
SOYCMS_TARGET_DIRECTORY: /home/****/****/public_html/
SOYCMS_TARGET_URL: undefined
SOYCMS_ADMIN_ROOT: undefined
SOYCMS_LANGUAGE: ja


どうぞよろしくお願いいたします。
投稿者:齋藤毅  投稿日時:2023-04-30 17:31:11
/home/****/****/public_html/home/****/****/public_html/GalleryImage/
のディレクトリに書き込み権限が無いことが原因かもしれません。
投稿者:オフィスニコ  投稿日時:2023-04-30 19:34:23
ありがとうございます。

確認しましたところ、ちょっと変なのですが、、、
/home/****/****/public_html/home/****/****/public_html/GalleryImage/ というディレクトリは存在しないのです。

/home/****/****/public_html/home/****/****/public_html/ と/home/~が2回続いていることも変なのです。
サーバーの仕様なのでしょうか。。
そんなディレクトリは無いです。

FTPで確認しますと
/home/****/****/public_html/soucmsインストールディレクトリ/~ となっています。

もし原因がお分かりでしたらお教えください。
よろしくお願いいたします。
投稿者:齋藤毅  投稿日時:2023-05-01 05:28:14
/home/****/****/public_html/home/****/****/public_html/ と/home/~が2回続いていることも変なのです。
上記の件ですが、SOY Galleryがご利用中のサーバの仕様にあっていないのかもしれません。

各々のギャラリの設定でアップロードディレクトリという項目がありますが、登録されている値を教えてください。

もしかしたら、アップロードディレクトリに
/GalleryImage/daimonji_gallery
と入力して更新したら動作するようになるかもしれません。

もし、すでに
/GalleryImage/daimonji_gallery
が入力されている場合は、更新のみ行うでも良いです
投稿者:オフィスニコ  投稿日時:2023-05-01 09:19:13
ご確認ありがとうございました。
アップロードディレクトリに

/GalleryImage/daimonji_gallery

を作成してみたら、うまくアップロードできるようになりました!

今度は、各画像の編集画面で各設定をして「更新」をしますと、下記のエラーが発生してしまいました。。

Fatal error: Uncaught Error: Function name must be a string in /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php:12 Stack trace: #0 /home/****/****/public_html/****/common/lib/soy2_build.php(8180): DetailPage->doPost() #1 /home/****/****/public_html/****/common/lib/soy2_build.php(8167): WebPage->prepare() #2 /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php(27): WebPage->__construct() #3 /home/****/****/public_html/****/common/lib/soy2_build.php(5548): DetailPage->__construct(Array) #4 /home/****/****/public_html/****/app/webapp/gallery/admin.php(101): SOY2HTMLFactory::createInstance('DetailPage', Array) #5 /home/****/****/public_html/****/app/base/CMSApplication.class.php(414): SOYGalleryApplication->main() #6 /home/****/****/public_html/****/app/index.php(9): CMSApplication::run() #7 {main} thr in /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php on line 12

エラーメッセージ
Uncaught Error: Function name must be a string in /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php:12 Stack trace: #0 /home/****/****/public_html/****/common/lib/soy2_build.php(8180): DetailPage->doPost() #1 /home/****/****/public_html/****/common/lib/soy2_build.php(8167): WebPage->prepare() #2 /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php(27): WebPage->__construct() #3 /home/****/****/public_html/****/common/lib/soy2_build.php(5548): DetailPage->__construct(Array) #4 /home/****/****/public_html/****/app/webapp/gallery/admin.php(101): SOY2HTMLFactory::createInstance('DetailPage', Array) #5 /home/****/****/public_html/****/app/base/CMSApplication.class.php(414): SOYGalleryApplication->main() #6 /home/****/****/public_html/****/app/index.php(9): CMSApplication::run() #7 {main} thr

レポート
DETECT DATE: 2023-05-01T09:11:34+09:00

MESSAGE: Uncaught Error: Function name must be a string in /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php:12
Stack trace:
#0 /home/****/****/public_html/****/common/lib/soy2_build.php(8180): DetailPage->doPost()
#1 /home/****/****/public_html/****/common/lib/soy2_build.php(8167): WebPage->prepare()
#2 /home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php(27): WebPage->__construct()
#3 /home/****/****/public_html/****/common/lib/soy2_build.php(5548): DetailPage->__construct(Array)
#4 /home/****/****/public_html/****/app/webapp/gallery/admin.php(101): SOY2HTMLFactory::createInstance('DetailPage', Array)
#5 /home/****/****/public_html/****/app/base/CMSApplication.class.php(414): SOYGalleryApplication->main()
#6 /home/****/****/public_html/****/app/index.php(9): CMSApplication::run()
#7 {main}
thr
EXCEPTION TYPE: ErrorException
LOCATION: /****/app/webapp/gallery/pages/List/DetailPage.class.php (12)

SOY CMS Version: 3.11.32
SOY CMS Build Date: 2023-04-25T13:49:23+09:00
SOY CMS DB Type: sqlite
SOY2RootDir: /home/****/****/public_html/****/app/webapp/gallery/src/
SOY2_DOCUMENT_ROOT: undefined


STACK TRACE
-----------------------
0:soycms_shutdown

()

Server Environment
PHP Version: 7.4.33

PHP SAPI NAME: fpm-fcgi
PHP SAFE MODE: No
SHORT_OPEN_TAG: Yes

MEMORY_LIMIT: 1G Bytes
Memory Usage: 998,648 Bytes
2,097,152 Bytes (Real)
1,003,488 Bytes (Peak)
2,097,152 Bytes (Peak, Real)

MAX_EXECUTION_TIME: 180 sec.
POST_MAX_SIZE: 1G Bytes
UPLOAD_MAX_FILESIZE: 1G Bytes

mb_string: Yes
PDO: Yes
PDO_SQLite: Yes
PDO_MySQL: Yes
Standard PHP Library: Yes
SimpleXML: Yes
JSON: Yes
Services_JSON: No
ZIP: Yes
ZipArchive: Yes
Archive_Zip: No
OpenSSL: Yes
HASH: Yes
GD: Yes

Module/CGI CGI
Rewrite Unknown

USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
REQUEST_URI: /****/app/index.php/gallery/List/Detail/6
SCRIPT_NAME: /****/app/index.php
PATH_INFO: /gallery/List/Detail/6
QUERY_STRING:

DOCUMENT_ROOT: /home/****/****/public_html
SCRIPT_FILENAME: /home/****/****/public_html/****/app/index.php

SOY CMS Options
SOYCMS_ALLOWED_EXTENSIONS: undefined
SOYCMS_ALLOW_PHP_SCRIPT: undefined
SOYCMS_SKIP_MOBILE_RESIZE: undefined
SOYCMS_BLOCK_LIST: undefined
SOYCMS_TARGET_DIRECTORY: /home/****/****/public_html/
SOYCMS_TARGET_URL: undefined
SOYCMS_ADMIN_ROOT: undefined
SOYCMS_LANGUAGE: ja

何度もすみません。
よろしくお願いいたします。
投稿者:齋藤毅  投稿日時:2023-05-01 09:30:15
/home/****/****/public_html/****/app/webapp/gallery/pages/List/DetailPage.class.php
の12行目にあります

$image = SOY2::cast($soygallery_get_image_object($this->id), (object)$_POST["Image"]);

$image = SOY2::cast(soygallery_get_image_object($this->id), (object)$_POST["Image"]);
にすれば良いです。
投稿者:オフィスニコ  投稿日時:2023-05-01 11:18:03
ありがとうございます!
無事に編集ができました。

今後ともよろしくお願いいたします。
投稿者:オフィスニコ  投稿日時:2023-05-01 15:59:18
お世話になっております。

たびたびすみません;
また別のエラーが出てまいりました。

今度は、編集時に記入したURLをクリックしますと下記のエラーが表示されます。

Warning: A non-numeric value encountered in /home/****/****/public_html/****/app/webapp/gallery/page.php on line 109

Warning: A non-numeric value encountered in /home/****/****/public_html/****/app/webapp/gallery/src/logic/PagerLogic.class.php on line 64

Warning: A non-numeric value encountered in /home/****/****/public_html/****/app/webapp/gallery/src/logic/PagerLogic.class.php on line 77

Warning: A non-numeric value encountered in /home/****/****/public_html/****/app/webapp/gallery/src/logic/PagerLogic.class.php on line 78

URLとは、対象画像の個別ページへのURLと認識しているのですが
間違っていますでしょうか?

それから、これはエラーについてではないのですが
1ページあたりに表示するサムネイルの数を指定することはできますか?

以上、何度も申し訳ないのですが
よろしくお願いいたします。
投稿者:齋藤毅  投稿日時:2023-05-01 16:10:17
今度は、編集時に記入したURLをクリックしますと下記のエラーが表示されます。
上記の内容は意味がわからないのですが、下記のURLに記載されている内容で解決しますか?
手動で表示変更するおすすめ商品一覧として利用する - SOY Gallery

一応、エラーが出ないようにする方法をお伝えしておきます。
/home/****/****/public_html/****/app/webapp/gallery/page.php
の108行目付近の
if(is_null($page)) $page = 1;

if(!is_numeric($page)) $page = 1;
にすれば良いです
投稿者:オフィスニコ  投稿日時:2023-05-01 16:20:00
参考ページを拝見しましてURLの件、理解できました。
表示件数も設定欄で見つけました。

ありがとうございました。
ログインして投稿する