Apache Lounge


About Forum Index Downloads Search Register Log in RSS X

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP: What replaced register_globals? (Old pages won't load)

Joined: 13 Nov 2022
Posts: 2
Location: France

PostPosted: Sun 13 Nov '22 14:32    Post subject: PHP: What replaced register_globals? (Old pages won't load) Reply with quote

Feeling very much out of my depth here, but encouraged by "no question too simple!"

I'm attempting to update my partner's website, untouched since 2018 due to a stroke. First objective: a functioning local test site. I'm moderately tech confident but can't properly understand code.

I've fresh installed Ubuntu 22.04.1 as a guest on VirtualBox running on my Manjaro Gnome host machine and installed the LAMP stack, with Apache/2.4.52 (Ubuntu), MariaDB rather than MSQL and PHP 8.1. Didn't install MyPHPadmin. Verified setup working, then downloaded all the files from the live site with Filezilla and put them in /var/www/html. Everything works except for the display of images of artwork when called for from any of the relevant links. Since it all works fine on the live site, also on PHP 8.1, I'm assuming the problem is not with the code on any of the pages but with the configuration of either apache2 or PHP. And that's where I quickly get out of my depth.

There are no obviously relevant warnings in the error log.

Digging back into early correspondence with the guy who created the website (the nephew of a close friend who has long since moved on), I'm reminded that there was a similar problem when PHP evolved between versions and register_globals was defaulted from "on" to "off". Switching it back on got the site fully functioning again. But register_globals has long since disappeared, so how should PHP be configured to enable pages that depended on register_globals being on to function? I've tried googling this but again quickly get out of my depth.

Of course it may not be register_globals that is causing the problem. I've tried enabling a few additional modules that looked as though they might be relevant (ie rewrite, include, imagemap) but I'm stabbing in the dark. I've also installed (suggested by someone in Linux questions forum) php-gd and php-imagick, but again to no effect.

To see the specifics of the problem see this page on the live site, [url]diclay.co.uk[/url] which contains a grid of thumbnail links to individual artwork pages, each of which in turn contains some introductory text and a sequence of images. These same artwork pages can also be accessed from links in the other sections of the site. But on the local test site, all of these links produce a 404 Page not Found. However, on scrutinising the source code for the Artworks page, it looks as though all the links to bring up the individual artwork pages are listed at the bottom of the page, and each of those links, eg <href='artwork/rose'> suggests a two tier structure. In the artwork folder however (/var/www/html/artwork) the folders containing the images and notes for each artwork page were inside a folder called "images". So I tried copying those folders directly into the "artwork" folder, which proved successful: instead of a 404 page those links (eg http://localhost/artwork/rose) now return what I'd call a "skeleton page", like this:

Index of /artwork/rose
[ICO]   Name   Last modified   Size   Description
[PARENTDIR]   Parent Directory       -    
[IMG]   dni_rose_tn.jpg   2022-11-09 16:33    21K   
[IMG]   rose1.jpg   2022-11-09 16:33    22K   
[IMG]   rose2.jpg   2022-11-09 16:33    22K   
[IMG]   rose3.jpg   2022-11-09 16:33    21K   
[IMG]   rose4.jpg   2022-11-09 16:33    22K   
[IMG]   rose5.jpg   2022-11-09 16:33    20K   
[IMG]   rose6.jpg   2022-11-09 16:33    20K   
Apache/2.4.52 (Ubuntu) Server at localhost Port 80

So that leaves me still with two unresolved issues: First, the live site has the artwork/images/folder-for-each-artwork structure and apache has no problem finding its way through the redundant "images" folder. Secondly, having removed that layer on the test site, why is apache not now rendering the pages fully?[/code][/url]
Back to top

Joined: 13 Nov 2022
Posts: 2
Location: France

PostPosted: Mon 14 Nov '22 12:54    Post subject: Reply with quote

Finally cracked it! I always suspected it was a simple configuration issue. Editing apache2.conf and changing every instance of "Override None" to "Override All" solved the problem and got all pages loading properly.
Back to top

Reply to topic   Topic: PHP: What replaced register_globals? (Old pages won't load) View previous topic :: View next topic
Post new topic   Forum Index -> Other Software