forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: webhostingelite on December 09, 2009, 06:33:56 am

Title: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 09, 2009, 06:33:56 am
Running CPG 1.4.25, ModPack (works), Photoshop Plugin, PayPal and PayPal Sandbox, Godaddy Linux, PHP 5x, MySql 5.0, SSL is installed. OK, I am a nooby so I need some help!

I have purchases set for downloads. I have not changed any "custom fields" and she had them set to 1.Location, 2.Interests, website , Occupation, 5 is blank and 6 is biography...I did not change any confirmation email fields yet. Does paypal require them to be set to street address, city, state, country etc...?

I CHMOD to 755 on albums folder and the modpack works. IPN Log file is also 755 and works. Do any other folders require CHMOD to 755 or 777 for the shop and IPN?

I can purchase a pic thru PayPal and the IPN log is logging fine but I get a 7 Invalid 0 at the end of the transaction. IF I issue a refund in PayPal the IPN log file shows an 8 Verified for that transaction. I am using the https:// url in paypal IPN. https://www.cristinavelinaphotography.net/photogallery/index.php?file=photo_shop/photo_shop_paypal_ipn&action=ipn

When returning from PayPal back to my clients website (it uses the action=return at the end of that same link above), I get an internal server error 500. I looked thru the SERVER error log and here is what I get.

[Mon Dec  7 17:36:58 2009] [error] [client 24.xxx.xxx.30] FastCGI: comm with server "/home/content/x/y/z/justapath/html-x-httpd-php5" aborted: error parsing headers: malformed header 'index.php'

That is all I can think of at the moment and I have read thru as many posts on here for 3 days and I am getting frustrated so decided to ask for some advice and help! Thanks all in advance!

Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 09, 2009, 06:00:12 pm
OK folks, here is my issue simplified.

When Returning from PayPal to my clients CPG website, I get the Internal Server 500 error.

Could it be something with the action=return code?

I had the same problem on my other server with PHP4, now using PHP5

*could it be something with .htaccess and fastcgi?
*could it be anything with the php.ini? I looked at it and allow_url_fopen is = off, does that need to be turned on?

I could deal with shutting the PayPal return URL off and not getting the error at which time my client would have to manualy mark the order paid and HIT D to create the download directory, but it would be great to have it automated.
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Stramm on December 09, 2009, 09:15:53 pm
I can purchase a pic thru PayPal and the IPN log is logging fine but I get a 7 Invalid 0 at the end of the transaction. IF I issue a refund in PayPal the IPN log file shows an 8 Verified for that transaction. I am using the https:// url in paypal IPN. https://www.cristinavelinaphotography.net/photogallery/index.php?file=photo_shop/photo_shop_paypal_ipn&action=ipn

Make sure you've set within both, PayPal settings and the shop plugin the same currency...

Check the merchant email for unwanted chars at the beginning and the end (space)
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 02:13:38 am
I have the currency for both set to EUR and double checked the email address for spaces. My clients email address has a . (period) in the name like firstname.lastname@gmail.com but no space before or after the name etc.

My client is in Romania, so the PayPal merchant email address in CPG photoshop is set to https://www.paypal.com/ro/cgi-bin/webscr etc.

I have the pic set at 1EUR if you want to try it I will give you a FULL REFUND OR I can send you a couple bucks for the PayPal first if needed!  I am doing this particular job for next to nothing ...I have multi-user "admin access" and "refund" access to her PayPal so the refund can be immediate refund.

 Stramm, for you I would give FTP, hit me up via email if you have time for it! We do reseller hosting and this very well might lead to some extra work for both you and I ....and could be great for all of us :).

Thanks again for your help and interest in getting this going, Jeff



Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 02:21:25 am
I have the currency for both set to EUR and double checked the email address for spaces. My clients email address has a . (period) in the name like firstname.lastname@gmail.com but no space before or after the name etc.

My client is in Romania, so the PayPal merchant email address in CPG photoshop is set to https://www.paypal.com/ro/cgi-bin/webscr etc.

I have the pic set at 1EUR if you want to try it I will give you a FULL REFUND OR I can send you a couple bucks for the PayPal first if needed!  I am doing this particular job for next to nothing ...I have multi-user "admin access" and "refund" access to her PayPal so the refund can be immediate refund.

 Stramm, for you I would give FTP, hit me up via email if you have time for it! We do reseller hosting and this very well might lead to some extra work for both you and I ....and could be great for all of us :).

Thanks again for your help and interest in getting this going, Jeff




sorry, I clicked on the check to see what it was, ..I am very new here lolz
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 08:32:05 am
Interesting, if I make a CD and purchase it, the paypal IPN returns valid and it is automatically mark paid, but I am still getting internal server 500 error upon returning from Paypal.

Maybe I did not install the modpack and photoshop correctly, do you happen to have a zip of CPG, modpack, and photoshop I could download from you?

If not, maybe it is time to reinstall everything an have another crack at it.

Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Stramm on December 10, 2009, 08:42:36 am
Check the server error log for more info.
Maybe reupload
photo_shop_paypal_ipn.php
and
photo_shop_paypal_ipn_cls.php
again.

The return part just displays a message (Thanks for the purchease) and redirects to the index. So you could set another return URL (photo shop config) if it won't work for you at all. But with having a look at the error log you should be able to find out the reason.
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 08:58:33 am
OK, maybe I missed the boat on installing the photoshop. I am thinking, it is a plugin, so I uploaded all files in that whole photoshop folder to the plugin folder and then I ran install plugin in the cpg admin.

Just to make sure, is that what I was suppose to do???? or "should I have taken all the files that were in the photoshop include folder and overwrite the main CPG include folder" like what you told me to do on the modpack...

If so, Should I do the sql and and lang folders like that too?

I will wait to hear back from you on this one before I proceed. Thanks again Stramm.
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Stramm on December 10, 2009, 09:01:54 am
it's a plugin... the unpacked photo_shop folder needs to be uploaded into the plugins dir.
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 09:08:54 am
OK, that is what I originally did. I will try uploaded the IPN files again...
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 09:46:45 am
I uploaded them again and did another transaction. The money makes it to her paypal but when returning to her website from PayPal I still get the internal server 500 error. Also, the order does not get marked to Paid. Here is the error from my error log.

[Thu Dec 10 01:40:36 2009] [error] [client 24.xxx.xxx.30] FastCGI: comm with server "/home/content/c/r/s/cristina/html-x-httpd-php5" aborted: error parsing headers: malformed header 'index.php'
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 10:45:48 am
I made a thank you .php page for the return url in the admin shop config. It makes it to paypal and then from PayPal back to her server to the new thank you page without any errors, but it is not showing up paid until the admin manually marks it as paid.

*Is there a place to download an alternative like that for the shop?

If selling a "photo" for download, is it OK to leave the CD on 0 (zero) or does that need to be set on at least 1?

Thanks again, Jeff
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 10:53:11 pm
Hosting configuration 2.0 with godaddy (now is called 2.1 and they say scripts can be run from anywhere)

By default, files with a .php extension run under PHP 4 and files with the .php5 extension run under PHP 5. The .htaccess file, located at the root of your site, can be used to change these default settings. The following entries in a directory's .htaccess file designate .php files to run under PHP 5 and .php4 files to run under PHP 4.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

So, if we check the error I am getting it is:
[Mon Dec  7 17:36:58 2009] [error] [client 24.xxx.xx.30] FastCGI: comm with server "/home/content/x/y/z/justapath/html-x-httpd-php5" aborted: error parsing headers: malformed header 'index.php'

you can see the error is from "FastCGI". So, now I am thinking, do I add the .htaccess AddHandler for PHP 4 and php 5 in or do I try to write code to deny "fastcgi" all together... OR can I try to rename the main page in CPG to index.php5 and try to take advantage of the fastcgi and see if we can get it working for the future.

this code could be used to block it in htaccess?
<Files fastphp.ini>
order allow,deny
deny from all
</Files>

Seems very strange because they are not running from CGI, but the server config is setup to take advantage of fastcgi from anywhere on the server now and associates the .extension .php or .php5 with the associated version respectively.

It will be great the "photoshop" setup with the new SERVER configuration and I spent so much time in google it seems like there are a ton of PHP applications that are giving the same errors with SERVER config 2.0. Joomla has quite a few and wordpress also, and we all know these are world class apps...

Anyway, this gives us food for thought and things to try. I posted info and ideas I could find so maybe others that come along with Server configuration 2.0 can help and contribute too! If I get things working on this configuration I will post my findings for all...

Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 10, 2009, 11:01:24 pm
sorry, the bold index.php5 above should have been index.php4
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 11, 2009, 02:50:36 am
OK, I am making progress. Adding AddHandler x-httpd-php5 .php to the .htaccess is allowing the order to come back from PayPal with IPN approved!

NOTE: I also changed my php5.ini file allo_url_open = on.
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 11, 2009, 04:51:48 am
If I make my own thankyou.php page for the return URL with no variables in it, the order goes thru paypal fine and returns the customer back to the site fine.

For my thankyou.php page "I get the P Shop PayPal IPN log" but if I try to use the default index.php?file=photo_shop/photo_shop_paypal_ipn&action=return "why do I get the Internal Server 500 error and I don't get the P. Any ideas?

Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 11, 2009, 06:50:56 am
In CPG admin with logging and statistics, then view log, I can read the security log, but the path to view the text file log is bad. there is my error below. Any Ideas how to fix that? It reads it fine from the shop admin but was wondering about this area also...



/include/logger.inc.php

    * Warning line 66: include(logs/paypal_ipnlog.log.php) [function.include]: failed to open stream: No such file or directory
    * Warning line 66: include() [function.include]: Failed opening 'logs/paypal_ipnlog.log.php' for inclusion (include_path='.:/usr/local/php5/lib/php')
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 11, 2009, 10:49:28 am
Database Config: I would like to double check this configuration with you.

My tables in the mysql are prefixed cpg_ so I have "cpg_shop_" tables pertaining to the shop.

when I look through the photo_shop_paypal_ipn.php and look at the queries, it has
INSERT INTO `{$CONFIG['TABLE_SHOP_PAYPAL_LOG' and the other ones as well.

Should there have been a line updated in my config.inc.php when I installed and ran update?
The only one I have in the config.inc.php is the $CONFIG['TABLE_PREFIX'] =  'cpg_'; for the original CPG install.


 

Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on December 12, 2009, 01:54:14 am
Hey Stramm, my environmental variable for _server is _SERVER["HTTP_HOST"] and _env host is _ENV["HTTP_HOST"] . Could that be why I am having problems with my parsed header error and receiving internal server 500 error?

Would the fputs and fsockopen be affected by this? I don't know what $url_parsed[host] section does cuz I am not a PHP programmer. Please respond this one :)

I have the CPG in a folder called photogallery located here: https://www.cristinavelinaphotography.net/photogallery

Is it possible we could hardcode the URL parsed host and path sections for testing?

Thanks for hanging in there with me!

*here is the error in my error log again:
[Tue Dec  8 20:20:59 2009] [error] [client 24.xxx.84.30] FastCGI: comm with server "/home/content/c/r/i/criseller2/html-x-httpd-php5" aborted: error parsing headers: malformed header
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Gene-2008 on January 20, 2010, 12:18:14 am
If you are still having this issue with a IPN reply    action=return      this is what I found I had to do to fix it.

In the file: photo_shop_paypal_ipn.php

Add the $header_location equation and pay note to the addition of the Unix in the match pattern.
Also note I set Refresh to 8 for some delay to allow user to see the message.

Code: [Select]
require('photo_shop_paypal_ipn_cls.php');
$p = new photo_shop_paypal_class;

$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami|Unix/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 8; URL=' : 'Location: ';

switch ($_GET['action'])


I don't know why this is not set here as a matter of course....?

Hope this helps,
Gene
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: webhostingelite on January 20, 2010, 09:44:25 pm
Thanks Gene, I appreciate your help very much.

That fixed the malformed header when returning from PayPal and I don't get the Internal 500 Server Error anymore.
I don't see the return message and I don't get the 8 second refresh, mine is just going instantly to the regular startup page, the index.php page.

***I made some other changes, so I will put them back and give it another test.

***Any thoughts for other changes I might have to make? I might have to offer you something to fix it for my client!
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Gene-2008 on January 20, 2010, 10:21:49 pm
Note this code checks to see if your server is one on the first list.  If so it uses the 'Refresh: 8; URL=' and appends the url to go to.
If your server is NOT on the list then it picks the 'Location: ' and goes there....

$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami|Unix/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 8; URL=' : 'Location: ';

The following code determines what happen after receiving the "return" from IPN.

      $redirect = "index.php";
      header($header_location . $redirect);


BTW I do contract work...
Gene
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Stramm on January 22, 2010, 08:42:23 pm
Good work, thanks for contributing your findings.
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: BillyWardrop on March 02, 2010, 04:34:17 pm
Hi

I've tried adding the $header_location code to my photo_shop_paypal_ipn.php file but it just takes me back to the home page of my gallery. When I click my orders, my image is set to unpaid even though I paid for it.

My Gallery address is http://www.petehumephotography.co.uk/photogallery/


My code is as follows:


   case 'return':

      $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami|Unix/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 8; URL=' : 'Location: ';
      $redirect = "index.php";
      header($header_location . $redirect);
      pageheader($lang_info, "<META http-equiv=\"refresh\" content=\"15;url=$redirect\">");
      msg_box($lang_photoshop_ipn['success'], $lang_photoshop_ipn['thank_you'], $lang_continue, $redirect);
      pagefooter();
      //foreach ($_POST as $key => $value) { echo "$key: $value<br>"; }

      break;

My website is hosted on Linux shared hosting.

Thanks


Billy
Title: Re: Photoshop plugin, IPN, PayPal issue
Post by: Joachim Müller on March 02, 2010, 04:36:48 pm
Locking. Start a thread of your own please.