Components Anywhere

Plugin enabled and curl enabled but error message still showing in HTML source.

11 months 3 days ago #76718

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

Hello all, I have installed and enabled the plugin, but I still cannot get the component to show the content in an article, and the usual error message is still shown in the HTML.

<!-- START: Components Anywhere --><!--  Components Anywhere Message: The component cannot be placed because an invalid URL is given or the page timed out. --><!-- END: Components Anywhere -->

I have enabled the plugin, and tried changing the order, but no luck.

I have tried SEF and full urls in the syntax, but no change.

I have trued these:
{component index.php?option=com_content&view=article&id=79}
{component membership}

Is there anything else to test? I have also trued different settings in the plugin, but no change.

Thanks!

Confidential information:
(hidden)

11 months 3 days ago #76719

Peter van Westen's Avatar Peter van Westen Admin

Try playing with the Components Anywhere system plugin settings.

11 months 3 days ago #76720

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

Hi Peter, thank for the quick reply. I have tried the different settings in the plugin area, but no luck unfortunately.

11 months 3 days ago #76722

Peter van Westen's Avatar Peter van Westen Admin

Your server, or maybe some plugin you have installed, is probably blocking the cUrl calls to collect the component page contents.

Can you also give me (s)ftp access so I can take a deeper look?

11 months 3 days ago #76723

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

Thank you Peter, here are the credentials:

Confidential information:
(hidden)

11 months 3 days ago #76726

Peter van Westen's Avatar Peter van Westen Admin

When querying the url via cUrl (php), which in you case is:

.../membership?tmpl=component&amp;rendercomponent=1
The result is a '301 permanently moved' error. So it looks like your .htaccess or some server setting is getting in the way.

11 months 3 days ago #76727

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

That's very helpful Peter, thanks.

I'll do some testing with the .htaccess file and check again.

11 months 3 days ago #76728

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

Hi Peter,
I tried deactivating SEF URLs and renaming the .htaccess file, but no luck.
Do you have any other suggestions, or is there something specific I should ask the hosting provider (SiteGround)?
Thank you again.

11 months 3 days ago #76729

Peter van Westen's Avatar Peter van Westen Admin

Best to ask your host.

11 months 3 days ago #76730

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

Hi Peter,

I contacted the host, and they said they upgraded the PHP version and cleared the cache, which they said would fix the issue, but it has not.

Can I ask when you do the php query, are you doing that just through uploading a file via Ftp?

Thank you.

11 months 3 days ago #76731

Peter van Westen's Avatar Peter van Westen Admin

Components Anywhere will use php cUrl to collect the contents of the url you tell it to. It does this via a special url that outputs json format:

.../membership?tmpl=component&amp;rendercomponent=1
As you can see, if you open that url in your browser, it will load as it should.
However, when this url is loaded through cUrl, your server/setup returns the 301 error.

This is an issue caused by something on your server. And is therefor outside the control of Components Anywhere. So not something I can solve for you.

SiteGround should be able to see what is causing this.
When they test the cUrl, make sure they don't simply test this via the terminal (a php curl ...' call), but do this via an actual php file.
As the results between curl via a php file and a curl call done via the terminal can differ.

11 months 3 days ago #76732

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

Thank you for the explanation Peter.

When you tested, did you upload a file through FTP that I could use to re-test?

11 months 3 days ago #76734

Peter van Westen's Avatar Peter van Westen Admin

I have temporarily added some testing code to:

/plugins/system/componentsanywhere/src/Curl.php
You can test the output by adding ?x=1 to the frontend url.
So check:
.../testing?x=1
Best to see the result in the 'View Page Source' view.

11 months 2 days ago #76750

Nicholas Hudson-Ellis's Avatar Nicholas Hudson-Ellis

To provide an update on this, I wasn't able to resolve it on the Staging site, and SiteGround was not much help.

In the end I decided to test on my Live website, and it worked!

Thanks for your help Peter, if you wanted to see the working page, it is here:

Confidential information:
(hidden)

11 months 2 days ago #76751

Peter van Westen's Avatar Peter van Westen Admin

Ok, great to hear you have it working