Jump to content

Could really use some basic assistance, please!


WorldwideGaming

Recommended Posts

Older database developer here.  Never really used PHP except for minor fixes to existing code here and there, so basically a newbie w/ PHP. 

Anyway, I've got some PHP that I tossed together to create a basic Google Product feed file.  It was running fine until we switched back end Linux servers.  As far as I can tell, there must've been a change to the revision of PHP installed (both were/are on PHP 7.4.x, with the current server running 7.4.33. Not sure what the old server was on other than 7.4.x).

I'm REALLY hoping someone can spot the issue straight away!  I'll attach the PHP script and a screenshot of what's showing in the web browser and maybe someone here can point me in the right direction.

THANK YOU IN ADVANCE!

SS1.jpg

ProdFeedGen.txt

Link to comment
Share on other sites

46 minutes ago, Barand said:

You're best bet is to turn on display_errors in your php.ini file and also set the error reporting level to E_ALL. See what error messages you get.

I've got all my PHP error logging being sent to its own file one level up from my webroot (set inside the CLI php.ini file, along with display_errors and reporting level).  Running the script generates no errors - just the output in the attached screenshot on the original message.

Link to comment
Share on other sites

4 minutes ago, ginerjm said:

If you want to show us this error setting code (and more) please post readable real code and not some image of it.  That way somebody might play with it and test it out perhaps.  Can't do that with a pic.

The PHP code is in the TXT file attached to the original post.  The screenshot is the output in the web browser from trying to execute the code.

Link to comment
Share on other sites

changing your code from php short tag to <?php  and then adding error reporting and display errors as such displays

<?php
	error_reporting(E_ALL);
	ini_set('display_errors', '1');

 

Warning: require_once(/var/www/vhosts/worldwide-gaming.com/httpdocs/squirrelcart/pre_common.php): failed to open stream: No such file or directory in /var/www/html/ProdFeedGen.php on line 6

Fatal error: require_once(): Failed opening required '/var/www/vhosts/worldwide-gaming.com/httpdocs/squirrelcart/pre_common.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ProdFeedGen.php on line 6

and does not print code to screen.

These errors show for me due to the fact I am not using a full url to get to your require once file.

Edited by dodgeitorelse3
Link to comment
Share on other sites

Thanks for all the assistance!

Turned out the php short tag had the 'php' part of it stripped out somehow.  Added it back and boom, works.

No idea how it happened, but thanks to dodgeitorelse3 for pointing out the error reporting idea as that's what had me go back and look.

Thanks again all!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.