Access http interface from php script

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Eagle_Erwin
Blank Cone
Blank Cone
Posts: 14
Joined: 02 Feb 2007 12:51

Access http interface from php script

Postby Eagle_Erwin » 19 Sep 2008 11:11

Last week I updated form 0.8.6i to 0.9.2. Since then, I can't access the http-interface from a php-script with the command:

Code: Select all

file_get_contents("http://server:port/requests/status.xml");
It keeps loading and then times out. The page is reachable from Firefox and IE7. I've modified the .hosts-file, so it has to accept connections from all ip's and all interfaces.
Did the makers add some kind of protection against access from php-scripts that can be disabled, or do I have to do something else?

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Access http interface from php script

Postby dionoea » 19 Sep 2008 21:15

It's probably something else. Do you see the connection attempts in the VLC debug output?
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Harl
New Cone
New Cone
Posts: 7
Joined: 19 Sep 2008 22:00

Re: Access http interface from php script

Postby Harl » 19 Sep 2008 22:15

I have the same problem. I am using Java http client to read pages I generate with my custom http interface with RPN commands. The problem here is that the connection is not closed and the client waits and then time-outs. This applies for xml pages generated with RPN. Normal html pages work fine - connection is closed as expected.

You can check it with a request from firefox/IE and checking netstat -t in command line. It will show that the connection remains ESTABLISHED after you request e.g. status.xml page.

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Access http interface from php script

Postby dionoea » 20 Sep 2008 00:35

Ah ok, someone provided a patch a few weeks ago to fix this issue but we didn't apply it since nobody could tell if it was ok or not :) Maybe that's linked. Please post in this thread tomorrow to ask me to investigate further. I'll provide test builds for those who want (windows test builds).
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Harl
New Cone
New Cone
Posts: 7
Joined: 19 Sep 2008 22:00

Re: Access http interface from php script

Postby Harl » 20 Sep 2008 08:10

Can you please tell me where to get those test builds from ? I can test them. Thank you.

Eagle_Erwin
Blank Cone
Blank Cone
Posts: 14
Joined: 02 Feb 2007 12:51

Re: Access http interface from php script

Postby Eagle_Erwin » 20 Sep 2008 13:08

I'm glad to hear that I'm not the only one with the problem. I'm also very interested in the test builds.

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Access http interface from php script

Postby dionoea » 23 Sep 2008 01:28

0.9.3-git builds with patch from viewtopic.php?f=18&t=50480 applied are available here:
http://people.videolan.org/~dionoea/vlc ... x-win32.7z

Please report if they fix (or don't fix) your problem.

Thanks, (and sorry for the slight delay)
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Access http interface from php script

Postby dionoea » 23 Sep 2008 01:44

According to thedj that fix isn't correct ... but check if it works anyway ... might be helpful for people debugging.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Harl
New Cone
New Cone
Posts: 7
Joined: 19 Sep 2008 22:00

Re: Access http interface from php script

Postby Harl » 23 Sep 2008 20:44

He is right. It's not fixed. The http connection is not closed.

Eagle_Erwin
Blank Cone
Blank Cone
Posts: 14
Joined: 02 Feb 2007 12:51

Re: Access http interface from php script

Postby Eagle_Erwin » 23 Sep 2008 23:01

0.9.3-git builds with patch from viewtopic.php?f=18&t=50480 applied are available here:
http://people.videolan.org/~dionoea/vlc ... x-win32.7z

Please report if they fix (or don't fix) your problem.
The fix solved my problem, PHP scripts can now access the http pages through the function file_get_contents() without timing out. Thanks!

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Access http interface from php script

Postby dionoea » 24 Sep 2008 11:42

Ah well ... looks like the fix was correct after all. It should be included in the next release.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 4 guests