Piwigo needs the short_open_tags directive to be On in php #555

Closed
opened 2026-10-05 00:03:52 +02:00 by adam · 5 comments
Owner

I just spent 2 hours trying to make my gallery work (after moving server). I noticed at last that the source of the files provided by the server started with the following text :

<?

ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
#ini_set('error_log', PHPWG_ROOT_PATH . '/../piwigo-logs/error'.date(y-m-d).'.log'); 
error_reporting(E_ALL);
ini_set('error_log', PHPWG_ROOT_PATH . '/../piwigo-logs/error.log'); 


?>

This opened my eyes on the php configuration, and the "short_open_tags" directive was Off (while it was On on the old server).
Apparently, the gallery almost works with this setting, but some of the client-side scripts seems to disfunction. Hence the upload page, together with some feature are buggy (if working at all...).

I don't know yet which part of piwigo uses the "<?" short tag, but I'm looking to it.

I definitely think that Piwigo should work with short_open_tags set to Off (or eventually put a note on the administration page).

I just spent 2 hours trying to make my gallery work (after moving server). I noticed at last that the source of the files provided by the server started with the following text : ``` <? ini_set('display_errors', 'On'); ini_set('log_errors', 'On'); #ini_set('error_log', PHPWG_ROOT_PATH . '/../piwigo-logs/error'.date(y-m-d).'.log'); error_reporting(E_ALL); ini_set('error_log', PHPWG_ROOT_PATH . '/../piwigo-logs/error.log'); ?> ``` This opened my eyes on the php configuration, and the "short_open_tags" directive was Off (while it was On on the old server). Apparently, the gallery _almost_ works with this setting, but some of the client-side scripts seems to disfunction. Hence the upload page, together with some feature are buggy (if working at all...). I don't know yet which part of piwigo uses the "<?" short tag, but I'm looking to it. I definitely think that Piwigo should work with short_open_tags set to Off (or eventually put a note on the administration page). <!-- github-sync-id:201134088 -->
adam closed this issue 2026-10-05 00:03:52 +02:00
Author
Owner

After more investigations, I found that the file responsible for this code was local/config/config.inc.php
It contains the exact above-mentionned code. Should this be regarded as an issue?
I don't remember creating of modifying this file, but I may be wrong...

After more investigations, I found that the file responsible for this code was local/config/config.inc.php It contains the exact above-mentionned code. Should this be regarded as an issue? I don't remember creating of modifying this file, but I may be wrong... <!-- github-comment-id:274498773 -->
Author
Owner

Hi @goulou file local/config/config.inc.php is not provided by Piwigo : it is a "local" file. Piwigo itself always use <?php tag, never <?

Hi @goulou file local/config/config.inc.php is not provided by Piwigo : it is a "local" file. Piwigo itself always use `<?php` tag, never `<?` <!-- github-comment-id:274511731 -->
Author
Owner

Well, I can imagine that...
I think the bug could be closed if you confirm that Piwigo did not create this file (in this installation or in any previous version).
I searched Google to find why and how I could have invented those lines, but it didn't find anything...

Well, I can imagine that... I think the bug could be closed if you confirm that Piwigo did not create this file (in this installation or in any previous version). I searched Google to find why and how I could have invented those lines, but it didn't find anything... <!-- github-comment-id:274514804 -->
Author
Owner

did you use an automatic script to install Piwigo?

did you use an automatic script to install Piwigo? <!-- github-comment-id:274515424 -->
Author
Owner

I cannot remember, my installation is quite old now... Sorry...
When I did it, it was a conversion from a Menalto Gallery 3 instance, so if there was an automatic conversion script, I might very likely have used it.

I cannot remember, my installation is quite old now... Sorry... When I did it, it was a conversion from a Menalto Gallery 3 instance, so if there was an automatic conversion script, I might very likely have used it. <!-- github-comment-id:274516183 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#555