I used to run my piwigo installation on CentOS 7. Decided it was time to update my OS. So, backed up my photos directory and mariadb database. Then installed RHEL 9.
I have:
RHEL 9.3
php-8.0.30-1.el9_2.x86_64
mariadb-10.5.22-1.el9_2.x86_64
ImageMagick-6.9.12.93-1.el9.x86_64
httpd-2.4.57-5.el9.x86_64
I downloaded the latest version and extracted the contents from the piwigo directory to my photos directory. I then opened a web browser to the location and get a page that starts with:
0 && $page['start']>=count($page['items'])) { page_not_found('', duplicate_index_url(array('start'=>0))); } trigger_notify('loc_begin_index'); //---------------------------------------------- change of image display order if (isset($_GET['image_order'])) { if ( (int)$_GET['image_order'] > 0) { pwg_set_session_var('image_order', (int)$_GET['image_order']); } else { pwg_unset_session_var('image_order'); } redirect( duplicate_index_url( array(), // nothing to redefine array('start') // changing display order goes back to section first page ) ); } if (isset($_GET['display'])) { $page['meta_robots']['noindex']=1; if (array_key_exists($_GET['display'], ImageStdParams::get_defined_type_map())) { pwg_set_session_var('index_deriv', $_GET['display']); } } //-------------------------------------------------------------- initialization // navigation bar $page['navigation_bar'] =
Am I missing a step?
Offline
That looks very broken and much like a fragment of the index.php source code instead of being interpreted by the web server's PHP module. Make sure you have PHP correctly enabled. (though the page should not start with "0 && $page['start']"... as there's code before that and "0 && " shouldn't be there).
Offline
I made sure php was running with my httpd. I ran:
echo '<?php phpinfo(); ?>' > /var/www/html/index.php
restarted httpd and had a nice display of all the php version information. I deleted /var/www/html/photos. I created a new empty photos subdirectory. I then copied over the contents of the unzipped piwigo-13.8.0.zip archive. I restarted httpd and opened my browser to /photos and still see the same code. I had this running fine under CentOS 7.
Offline
I made a little progress. I moved the index.php aside and created a blank one. I then started adding the code from the original. With just:
<?define('PHPWG_ROOT_PATH','./'); include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); include(PHPWG_ROOT_PATH.'include/section_init.inc.php'); // Check Access and exit when user status is not ok check_status(ACCESS_GUEST); // access authorization check if (isset($page['category'])) { check_restrictions($page['category']['id']); }?>
in the file, it was a blank screen. As soon as I added:
<?define('PHPWG_ROOT_PATH','./'); include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); include(PHPWG_ROOT_PATH.'include/section_init.inc.php'); // Check Access and exit when user status is not ok check_status(ACCESS_GUEST); // access authorization check if (isset($page['category'])) { check_restrictions($page['category']['id']); } if ($page['start']>0 && $page['start']>=count($page['items'])) { page_not_found('', duplicate_index_url(array('start'=>0))); }?>
I got:
0 && $page['start']>=count($page['items'])) { page_not_found('', duplicate_index_url(array('start'=>0))); } ?>
displayed.
Has piwigo been tested on RHEL 9?
Offline
I don't know, but probably not. Anyway, there's a report of the same on Linux Mint 21 at [Forum, topic 188189] .
What happens if you run that snippet you created in PHP from command line? Output should be nothing. You could then try to insert
echo "test-start\n";
as very first command and
echo "test-end\n";
as last command to see if those are displayed or the script dies prematurely.
Offline
I went back to a blank index.php. I added in the piwigo original line by line. Everything was fine until I got to this point:
<?php echo "test-start\n"; // +-----------------------------------------------------------------------+ // | This file is part of Piwigo. | // | | // | For copyright and license information, please view the COPYING.txt | // | file that was distributed with this source code. | // +-----------------------------------------------------------------------+ //--------------------------------------------------------------------- include define('PHPWG_ROOT_PATH','./'); include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); echo "test-end\n"; ?>
. When I ran it, I got:
test-start Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/photos/index.php:1) in /var/www/html/photos/include/common.inc.php on line 86
I'll keep looking at it.
Offline