Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2019-11-20 18:43:45

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

PayPal issue

A customer emailed last night to say he'd tried to buy a print on my site and got the following error message when hitting the PayPal button...

"Unexpected error: Call to undefined function curl_init() in PayPalHelper.php on line 323"

On testing the button I get the same message.

Site has been up a couple of years and PayPal has always worked fine.

My site is http://leighonseaphotography.co.uk/

Many thanks,

Mark

Offline

#2 2019-11-20 19:27:38

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: PayPal issue

Hi Mark, it looks like the curl PHP module has been disabled or removed by your host. This could have been due to a server upgrade that dropped support. You’ll need to contact your host’s technical support to install or enable the curl module.

Offline

#3 2019-11-20 19:33:30

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Thank you

Offline

#4 2019-11-20 19:43:53

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

At first I wondered if it was a privacy issue because the site isn't https, so I got in touch with my server guy to see if he could sort me out with an SSL certificate. His reply below. Can you translate for a computer illiterate?

"hello!

it is the other way around,.. you hav an SSL certificat, because we can provide it for your site,
but your code seems like all designed for non-ssl

for example

    <link rel="stylesheet" type="text/css" media="all" href="http://leighonseaphotography.co.uk/backlight/publisher/resource.php?template=6&extension=css&name=style" />


you would need to edit your site to fully implement everything towards using https"

Offline

#5 2019-11-21 00:35:53

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: PayPal issue

It looks like you already have an SSL certificate. So the only thing you need to do (as far as I remember) is setting your Site URL in backlight>settings to use https:// instead of http://.

If this is working, don't forget to update the Lr Publisher URL to use https:// as well. Otherwise you can't publish from Lightroom anymore, in case you were doing this.

In order to force everyone to use https://, you can set this in backlight>settings>privacy: "Automatically Redirect Browsers To https" = true.


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#6 2019-11-21 03:22:02

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: PayPal issue

Daniel Leu wrote:

the Lr Publisher URL to use https:// as well. Otherwise you can't publish from Lightroom anymore, in case you were doing this.

In order to force everyone to use https://, you can set this in backlight>settings>privacy: "Automatically Redirect Browsers To https" = true.



If you’re not using Backlight 2, then see this thread about modifying your .htaccess file to do the redirect

http://community.theturninggate.net/vie … hp?id=7876


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2019-11-21 20:52:09

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Thanks Daniel and Rod,

Bear with me because I put together my website solely using the Designer and have never been anywhere near coding before.

Here's what I've done so far. Using FileZilla, I've connected to the server and found the .htaccess file, then opened it. My question is, does the new code replace something else, or do I add it in a particular place and leave everything else untouched?

This is what I'm seeing at the moment...

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /dev/simpleapp/

    #RewriteRule ^application/data/phpliteadmin.php$ index2.php [L,QSA]

    RewriteCond %{REQUEST_URI} ^.*/framework/.*$
    RewriteRule ^(.*)$ index.php [L]

    RewriteCond %{REQUEST_URI} ^.*/application/.*$
    RewriteRule ^(.*)$ index.php [L]

    #handle relative paths in css url('../img/....')
    RewriteRule /(img)/(.*)?$ resources/$1/$2 [L,QSA]
    RewriteRule ^resources/(css|js|images|img)/(.*)?$ resources/$1/$2 [L,QSA]
    #RewriteRule ^(resources/css|js|images/.*?)$ $1 [L,QSA]
   
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ %{REQUEST_FILENAME} [L]
   
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
   
    RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+).*$ index.php?c=$1&a=$2&p1=$3&p2=$4&p3=$5&u=%{REQUEST_URI}&mr=1&%{QUERY_STRING} [L]
    RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ index.php?c=$1&a=$2&p1=$3&p2=$4&u=%{REQUEST_URI}&mr=1&%{QUERY_STRING} [L]
    RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z0-9_]+)/?$ index.php?c=$1&a=$2&p1=$3&u=%{REQUEST_URI}&mr=1&%{QUERY_STRING} [L]
    RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)/?$ index.php?c=$1&a=$2&u=%{REQUEST_URI}&mr=1&%{QUERY_STRING} [L]
    RewriteRule ^/?([a-zA-Z_]+)/?$ index.php?c=$1&u=%{REQUEST_URI}&mr=1&%{QUERY_STRING} [L]
    RewriteRule ^.*$ index.php?%{QUERY_STRING}&mr=1&%{QUERY_STRING} [L]
   
</IfModule>

Offline

#8 2019-11-21 21:13:46

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: PayPal issue

I’m no expert in .htaccess, but it looks like you have several things in there unrelated to Backlight.

At any rate, try adding the code in the <IfModule mod_rewrite.c> section.
I don’t know if you should add it at the beginning or the end. I’d try it right at the beginning of that section first.,

http://community.theturninggate.net/vie … 289#p47289

You may need to clear browser cache after making the change (and perhaps template cache as well)


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#9 2019-11-21 22:10:34

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Thanks Rod.

I've had a go but after editing the file as below and trying to upload to the server, FileZilla says "Can't open that file. Operation not permitted. Critical transfer error."

# ------------------------------------------------------------------------------
# | Web fonts access                                                           |
# ------------------------------------------------------------------------------

# Allow access from all domains for web fonts

<IfModule mod_headers.c>
    <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
        RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    ############################################################################
    # Edit this section for servers using FastCGI

    # For FastCGI (or seeing the error message 'No input file specified.':
    # add # to the start of the next line
    RewriteBase /

    RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$

    # For FastCGI (or seeing the error message 'No input file specified.':
    # add # to the start of the next line and remove # from the line after)
    RewriteRule ^.*$ - [E=BASE:%2]
    #RewriteRule ^(.*)$ - [E=BASE:]

    ############################################################################



    RewriteRule ^(.*)$ - [E=QS:mod_rewrite=on]

    RewriteRule ^([^\/.]*)-single.php$ %{ENV:BASE}single.php?%{ENV:QS}&id=$1 [QSA,L]

    RewriteRule ^([^\/.]*).css$ %{ENV:BASE}index.php?%{ENV:QS}&extension=css&name=$1 [QSA,L]
    RewriteRule ^([^\/.]*).js$ %{ENV:BASE}index.php?%{ENV:QS}&extension=js&name=$1 [QSA,L]
    RewriteRule ^([^\/.]*).gif$ %{ENV:BASE}index.php?%{ENV:QS}&extension=gif&name=$1 [QSA,L]
    RewriteRule ^([^\/.]*).png$ %{ENV:BASE}index.php?%{ENV:QS}&extension=png&name=$1 [QSA,L]
    RewriteRule ^([^\/.]*).jpg$ %{ENV:BASE}index.php?%{ENV:QS}&extension=jpg&name=$1 [QSA,L]

    #RewriteCond %{QUERY_STRING} !mod_rewrite=on
    #RewriteRule ^index.php$ %{ENV:BASE}index.php?%{ENV:QS} [QSA,L]

    RewriteCond %{QUERY_STRING} !mod_rewrite=on
    RewriteRule ^mobile.php$ %{ENV:BASE}mobile.php?%{ENV:QS} [QSA,L]

    RewriteCond %{QUERY_STRING} !mod_rewrite=on
    RewriteRule ^(.*)download.php %{ENV:BASE}download.php?%{ENV:QS} [QSA,L]
   
    RewriteRule ^$ %{ENV:BASE}index.php?%{ENV:QS} [QSA,L]
   
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ %{ENV:BASE}index.php?%{ENV:QS}&page=$1 [QSA,L]

</IfModule>

Offline

#10 2019-11-21 22:31:02

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: PayPal issue

How are you editing?
Be sure to edit with a plain text editor.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#11 2019-11-22 01:28:03

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: PayPal issue

It doesn't look that you changed http to https in backlight/settings as mentioned before.


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#12 2019-11-22 10:14:14

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

You're right Daniel, I hadn't changed it.

All done now but I'm still getting the error message below after editing the .htaccess file and trying to upload it.


Status:    Starting upload of /Applications/Backlight-Pages-123-Release7/.htaccess
Command:    CWD /
Response:    250 OK. Current directory is /
Command:    TYPE A
Response:    200 TYPE is now ASCII
Command:    PASV
Response:    227 Entering Passive Mode (144,76,176,188,156,232)
Command:    STOR .htaccess
Response:    553 Can't open that file: Operation not permitted
Error:    Critical file transfer error

Offline

#13 2019-11-22 11:30:23

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: PayPal issue

Cool. Looks like https://leighonseaphotography.co.uk works now!

Unexpected error: Call to undefined function curl_init() in PayPalHelper.php on line 323

As Ben mentioned, it looks like the curl PHP module is missing in your installation. Did you contact your host?

Command:    CWD /

You can't upload something to '/'. You have to upload the file to the root directory of your site (eg, '~' or '/home/leighonseaphotography/public_html' or whatever the root directory of your site is).

BTW, I would recommend upgrading to Backlight 2 one of these days since many things have much improved. A little but handy new feature is the option for automatic redirect from http to https.


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#14 2019-11-22 17:47:18

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Thanks Daniel.

I did contact my host. He installed the php-curl module and asked me to test Paypal again. The problem isn't fixed.

Here's his reply...

ok i will check again, because your gallery that you use still requires php 5.X
which I do provide on the server, but it is seriously out of date

standard on the server is now php 7.3+

please talk to your web agency to mak some upgrades to the code and the site https ready
from my side the site has a ssl certificate and could be run in ssl, but the code is not ready for it it seems

Offline

#15 2019-11-22 18:00:47

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: PayPal issue

Our code runs from PHP 5.4 through to PHP 7.2 and presumably 7.3 but not tested with Backlight 1.

It definitely does NOT require PHP 5.4 or anything earlier than 7.2.  Can you ask your host what specifically he has found that requires PHP 5.4?

From the PHP reference manual, curl_init is available from PHP 4.0.2 to PHP 7: https://www.php.net/manual/en/function.curl-init.php There is no mention of it not being available in 7.3 or requiring version 5.*.

Offline

#16 2019-11-22 20:22:16

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Hi Ben,

Success! Just tested the site after the guy sent me this...

i configured your site to now run php 7.3.X and chcking modules:

php7.3-curl ist schon die neueste Version (7.3.11-1+0~20191026.48+debian10~1.gbpf71ca0).

is installed
7.4 curl also

Offline

#17 2019-11-22 22:47:25

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Spoke a little too soon.

In going into the .htaccess file I appear to have screwed something up.

No Galleries page and I can't access my Backlight admin page either!

This is the error message (same on galleries and admin)...

Something went wrong
count(): Parameter must be an array or an object that implements Countable in SimpleHTMLTag.php on line 44

http://leighonseaphotography.co.uk/galleries/

Offline

#18 2019-11-23 00:23:25

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: PayPal issue

You might try php 7.2. As Ben said, Backlight 1 has not been tested on php 7.3


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#19 2019-11-23 00:38:19

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Thanks Rod, everything worked fine for a while. Do you not think the problem is something I've done?

Offline

#20 2019-11-23 01:00:06

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: PayPal issue

I don’t know.
We’re you ever able to upload the edited .htaccess file?

Looking through the forum, every time the error you’re getting pops up it seems to be related to php version.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#21 2019-11-23 01:28:17

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

rod barbee wrote:

I don’t know.
Were you ever able to upload the edited .htaccess file?

Looking through the forum, every time the error you’re getting pops up it seems to be related to php version.

I did manage to edit and upload the .htaccess file in the end. Everyone should be automatically directed to the secure site now.

All worked fine for a while - galleries, checkout and PayPal.

This error message on my galleries page and the admin site is different...

"count(): Parameter must be an array or an object that implements Countable in SimpleHTMLTag.php on line 44"

Just didn't want to hassle the host guy yet if it's something dumb I've done.

Last edited by Mark Taylor (2019-11-23 01:37:18)

Offline

#22 2019-11-23 01:45:32

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: PayPal issue

until Ben can weigh in, the only thing I can think of is reverting to an earlier php version, like 7.2
(I'm assuming you're using the most up-to-date version of Backlight 1?)

Ben may need to be able to login to your Backlight admin as well has have ftp access. You could save some time by emailing those credentials to him. You can email him by clicking the email link under his name in one of the posts above.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#23 2019-11-23 02:00:31

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Thanks Rod

Offline

#24 2019-11-23 06:27:37

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: PayPal issue

Please see my comment on this topic: http://community.theturninggate.net/vie … 871#p60871

Offline

#25 2019-11-23 09:06:35

Mark Taylor
Member
Registered: 2019-11-20
Posts: 22

Re: PayPal issue

Ben wrote:

Please see my comment on this topic: http://community.theturninggate.net/vie … 871#p60871

Thanks so much Ben, that has fixed it.

Hugely appreciated.

Mark

Offline

Board footer

Powered by FluxBB