Jump to content

PHP error


Tomas
 Share

This topic is 4308 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I'm trying to use SC in my CWP solution, with no luck. It's error from the beginning.

This is the code

include "supercontainer.php";



$sc = new SuperContainer('http://www.myserver.com/SC/Files/','Username','Password');

if ($sc->getError()) die('Could not connect to SuperContainer server: ' . $sc->getError());



The error I get is "Could not connect to SuperContainer server: The requested URL returned error: 401"

If I open a browser and type in http://www.myserver.com/SC/Files/ and submitting the same name and password I get the question about an applet and I'm lucky.

I'm using SC 4.71 on Mac 10.5.8

Help?

Link to comment
Share on other sites

I'm perfectly aware of that.

I have change the default SuperContainer path so in my case SC is corrects. I sad, if I take the url and put it in a browser everything works, that's what confusing me.

Link to comment
Share on other sites

A 401 error (in general) is a security problem, indicating that the username and password used to access a particular page is invalid, or no username and password was provided where one is required. In this case, I suspect that you may have specified your username and password parameters incorrectly, partiuclarly if it includes funny characters such as symbols, spaces, or anything other than plain text. All non-plain characters should be URL encoded.

Link to comment
Share on other sites

Lets take this from the top.

I have created a Super Container with the name SC and the username Username and password Password. If I use a webbrowser and type in the address to my supercontainer i get a question about name and pass. I type in Username and Password and get access. If I user the PHP code in my first post I get a 401 error. I do know that 401 means access denied.

Is there any thing I missed? Is my PHP correct? Are there any security settings on the server that my differ/need to be set? Could there be a license issue?

Any hint about the problem is welcome…. I'm lost :/

Link to comment
Share on other sites

Yes, it's possible that there is another security setting which you will need to adjust. You have made changes to your SuperContainer deployment beyond regular supported configuration, so I'm not sure how your folder permissions and server is set up, making it difficult to diagnose other problems. The one thing I can think of from the information that you have provided is that your username and password information is incorrect in your new SuperContainer() call, you have not properly escaped your characters, or that the other changes you have made to your deployment beyond what is supported by SuperContainer is preventing this from working. Changing your URL from SuperContainer/Files to SC may be causing the problem, I'm really not sure.

Your PHP looks correct, but you have take out all of the values in your php, so I can't test it myself or see if you have any typos in your code.

Link to comment
Share on other sites

Ok, to make everyone happy I have installed SuperContainer to a new server (still osx 10.5.8) default installation, doubleclick on the jar file. Provided a username and password (no fussy charters just a test/test username and password. The problem is I get the same result? I have a 3rd server installing from scratch that I will try on as soon as it's done later on to night...

sorry if I sound a bit irritated, but this problem annoys me right now... I do like SC in general, but my client (my customer) does not allow java witch forces me to make a lot of strange solutions and in this case use CWP for a problem I normally would use the Companion plugin to solve....

Link to comment
Share on other sites

Some update...

There seem to be some kind of bug in supercontainer.php. As soon as I use a password, any password, there is an error. I have solved my problem by using this code (obvious the path, server and password are not for real....)



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://localhost/SuperContainer/Files/Projekt/51/63');

curl_setopt($ch, CURLOPT_USERPWD, 'test:test');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);

curl_setopt($ch, CURLOPT_USERAGENT, "ME");

curl_setopt($ch, CURLOPT_FAILONERROR, true);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($ch, CURLOPT_NOBODY, true); 

curl_setopt($ch, CURLOPT_HEADER, true);

$buffer=curl_exec($ch);

curl_close($ch);

echo $buffer;



Link to comment
Share on other sites

You said you "double-clicked" the jar. Do you mean SuperContainerServer.jar? If so, this operates on port 8020, not on port 80. This is a separate deployment of SuperContainer from running the installer.jar and installing it with FileMaker Server, and runs and is configured separately. I do not recommend running two deployments on the same machine to avoid permission issues and confusion like what may be happening right now.

If you are running SuperContainerServer.jar and have the window popped up on your system and have configured your username and password on there you will need to specify port 8020 (http://yourserver.com:8020/SuperContainer/Files) in your server URL to connect to the stand-alone deployment rather than your filemaker server deployment.

If you are runnign standalone mode i recommend uninstalling the filemaker server deployment by re-running the installer.jar file and clicking "remove" to make sure that you don't end up getting conflicts.

Link to comment
Share on other sites

I have solved my problem and everything works without the supercontainer.php file.

There is no problem with my SuperContainer installation. Everything works from Filemaker and from the Webbrowser.

It's a bit strange that you don't seem to read my words. I do know English isn't my first language but I hope that you do understanding me. If you are interested I'm willing to set up a test environment for you to see the problem your self, just send me a PM. If you're not interested, well is your product and your customers...

Link to comment
Share on other sites

  • Newbies

I ran into the same problem. I replaced the following line of code in the supercontainer.php file:

curl_setopt($ch, CURLOPT_USERPWD, $this->baseUrl['user'] . ':' . $this->baseUrl['password']);

with:

curl_setopt($ch, CURLOPT_USERPWD, $this->urlParts['user'] . ':' . $this->urlParts['password']);

(Replaced baseUrl with urlParts).

Link to comment
Share on other sites

  • 1 month later...

This topic is 4308 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.