XF 2.1 PHP Error Running Media Gallery 2.1.5 on XF 2.15a (Photopost Gallery Import)

Oldengine

Active member
Running XF 2.15a with Media Gallery 2.1.5
Import 1.2.5 brought in the gallery database files.

The Photopost software originally had a root subdirectory /gallery/ which for the time being still exists.

While my XF board is up and running, I get a lot of these errors in the error_log
[13-Dec-2019 02:51:11 UTC] PHP Warning: require_once(./global.php): failed to open stream: No such file or directory in /home/smoky/public_html/gallery/gallery_global.php on line 58

54 // ######################### REQUIRE BACK-END ############################
55 require_once('./gallery_config.php');
56
57 chdir($forumpath);
58 require_once('./global.php');
59 require_once(DIR . '/includes/functions_gallery.php');

Gallery_config.php included this line to the site's forum root:
$forumpath = '/home/smoky/public_html/forum';

Evidently something got missed in an XF Media Gallery Config?
Maybe I need to move these files from site root to forum root?
Has anyone run into this error?
Your solution?
 
Last edited:
Which directory do you have XenForo installed in?

There are no requries needed for XenForo - so you've got something wrong with your config.
 
It likely is not a XenForo error as such, but XenForo is passing the error from an imported PhotoPost VBGallery to XFMG and the error relates to XFMG looking for something in the original /gallery file from where it transferred from. I suspect that it's one of those E.T. Phone Home links that many software sellers embed in their code and PhotoPost was well known for trickery to protect their assets.

This error is seen quite a few times out on the web from XenForo admins who have imported VBGallery to XFMG just as myself. It is only a PHP Warning, but it's filling my error_log.

XFMG resides where the XenForo importer. placed it into. The original directory is in the FORUMOLD folder on the same server in /gallery. I suspect that if I rename the /gallery folder or delete it, it may still cause the same error looking for it.
[13-Dec-2019 02:51:11 UTC] PHP Warning: require_once(./global.php): failed to open stream: No such file or directory in /home/smoky/public_html/gallery/gallery_global.php on line 58

The programmer of the XenForo Import script might want to investigate or maybe other astute programmers hanging on this forum.
 
Last edited:
You're missing the point.

XenForo does NOT "require" any PHP files from any other software. The only way you could be receiving that error message is because you don't have things set up correctly.

Again, which directory do you have XenForo installed in?
 
Your solution?
Without seeing your folder & files or knowing how you used to have it configured with vB...

My guess is that you're getting an error when visitors try going to a page in your PhotoPost install in the /gallery folder because the files it's looking for related to your vB install no longer exist. For example, if you try going to your {site}/gallery/index.php do you see an error being record from your own IP?

With that in mind, have you added any .htaccess redirects so that people going to your {site}/gallery are now redirected to your {XF}/media URL? If not, did you put anything in place anywhere to handle traffic that is still going directly to the old /gallery folder? If you've converted from vB to XF then, if my memory serves correctly, there are XF redirects available to handle traffic to your old vB URLs but since stuff like PhotoPost is a 3rd party product then the XF provided redirects don't handle those kinds of URLs and you need to implement something yourself. Years ago when I converted my last vB 3.x site to XF 1.x I just did a blind .htaccess 301 redirect for /gallery to /media (though in your case it'd be /forum/media).
 
Without seeing your folder & files or knowing how you used to have it configured with vB...

My guess is that you're getting an error when visitors try going to a page in your PhotoPost install in the /gallery folder because the files it's looking for related to your vB install no longer exist. For example, if you try going to your {site}/gallery/index.php do you see an error being recorded from your own IP?

With that in mind, have you added any .htaccess redirects so that people going to your {site}/gallery are now redirected to your {XF}/media URL? If not, did you put anything in place anywhere to handle the traffic that is still going directly to the old /gallery folder? If you've converted from vB to XF then, if my memory serves correctly, there are XF redirects available to handle traffic to your old vB URLs but since stuff like PhotoPost is a 3rd party product then the XF provided redirects don't handle those kinds of URLs and you need to implement something yourself. Years ago when I converted my last vB 3.x site to XF 1.x I just did a blind .htaccess 301 redirect for /gallery to /media (though in your case it'd be /forum/media).

This is the .htaccess that another programmer installed in addition to stuff that cPanel drops in.

.htaccess
Code:
#       Mod_security can interfere with uploading of content such as attachments. If you
#       cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#       SecFilterEngine Off
#       SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
        RewriteEngine On

        #       If you are having problems with the rewrite rules, remove the "#" from the
        #       line that begins "RewriteBase" below. You will also have to change the path
        #       of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo

        #       This line may be needed to workaround HTTP Basic auth issues when using PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
</IfModule>

My vB3 site was at /forum/ and the new XenForo is in that same folder. The old /forum folder being renamed.
The old /gallery folder is now in /forumold/gallery/ and the new XFMedia is in /forum/media/

There is likely a PHP workaround to dump the Warnings and it may be the easy way. The error written above is in /forum/error_log.
 
Last edited:
Top Bottom