Это php-приложение, работающее на Google App Engine. Я использую getImageServingUrl, чтобы получить URL-адрес и сохранить его для дальнейшего использования. Я фактически реализовал это в другой части приложения, но в этом случае при запуске код php останавливается прямо в точке, где я делаю вызов, чтобы получить URL-адрес. Нет ошибок на странице или в журнале App Engine. Есть ли другое место для получения ошибок? Мне не повезло, разыскивая проблему. Вот что у меня есть:
// At the top of the page I call this
use google\appengine\api\cloud_storage\CloudStorageTools;
// Some processing takes place to get the storage location of the image then
if (is_file($full_path_photo)) {
echo 'Getting URL...<br>';
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
echo 'Successful<br>';
};
// I've also tried it like this:
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo);
// And adding this before the call:
CloudStorageTools::deleteImageServingUrl($full_path_photo);
Когда я запускаю это, я получаю «Получение URL …», а затем ничего. Страница просто перестает выполняться.
Try / Catch удалось получить сообщение об ошибке для этого. В моем случае это была какая-то общая ошибка. Что касается общей проблемы, я думаю, что это как-то связано с моими ведрами. Я попробовал все это с другим ведром, и это, кажется, работает. Вот пример —
// At the top of the page I call this
use google\appengine\api\cloud_storage\CloudStorageTools;
// Some processing takes place to get the storage location of the image in GCP storage then
if (is_file($full_path_photo)) {
try {
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
throw new Exception();
} catch (Exception $e) {
echo 'Error: '.$e->getMessage().'<br>';
};
Спасибо за помощь, Том.
Других решений пока нет …