# Php client for Plex Media Server

**URL:** <https://forums.plex.tv/t/php-client-for-plex-media-server/8049>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [February 27, 2011, 6:45pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049 "2011-02-27T18:45:29Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![sonotone](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sonotone](https://forums.plex.tv/u/sonotone)\
**Post date:** [March 13, 2011, 11:07am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/21 "2011-03-13T11:07:40Z")

</div>

About multiples audio tracks with video, as far as i know, there is no html5 API implementation for audio selection. As transcoding is made by plex, i’ll take a look to the next release API to see if we can choose audio track.  
  
  
  
@ hd1080:  
  
If secure access is activate, you can’t stream audio to your browser. I currently have an ‘half’ solution, which works with images and audio, but not with video stream.  
  
Authentification problems are related about how PMS authentication is designed, it actually only accept http headers, which can’t be directly sent by browsers (however, you’ll be able to find plugins for those tasks).

---

<div class="post-metadata">

**Author:** ![oncleben31](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@oncleben31](https://forums.plex.tv/u/oncleben31)\
**Post date:** [March 13, 2011, 2:30pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/22 "2011-03-13T14:30:11Z")

</div>

Well done,   
  
I’ve test it and works quite well.

---

<div class="post-metadata">

**Author:** ![fabzzz](https://avatars.discourse-cdn.com/v4/letter/f/4491bb/32.png) [@fabzzz](https://forums.plex.tv/u/fabzzz)\
**Post date:** [March 14, 2011, 1:05pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/23 "2011-03-14T13:05:19Z")

</div>

Thanks for the job !!! it’s really nice !!!  
  
  
  
Just i found a bug : when i’m playing video and i click on one item from the left menu, the audio still playing however… I must quit safari to shutdown the audio stream and relaunch it to play another video…  
  
  
  
Do you have an idea for this problem ?  
  
  
  
Sorry for my english…  
  
  
  
Thanks

---

<div class="post-metadata">

**Author:** ![me2621a](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@me2621a](https://forums.plex.tv/u/me2621a)\
**Post date:** [March 14, 2011, 8:52pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/24 "2011-03-14T20:52:47Z")

</div>

> [@](#):
>
> I never played with Cappuccino. It will take some time to learn the framework, and i'm not sure i'll have enough time to rewrite the front-end with.

  
  
im not saying i have the time either but if i was to start playing around with it would that be ok?

---

<div class="post-metadata">

**Author:** ![sonotone](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sonotone](https://forums.plex.tv/u/sonotone)\
**Post date:** [March 15, 2011, 8:55am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/25 "2011-03-15T08:55:12Z")

</div>

> [@](#):
>
> im not saying i have the time either but if i was to start playing around with it would that be ok?

  
  
Sure it will :)  
  
We can continue this conversation on github, for technical details etc...

---

<div class="post-metadata">

**Author:** ![griffwill\_1](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@griffwill\_1](https://forums.plex.tv/u/griffwill_1)\
**Post date:** [March 17, 2011, 9:02am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/26 "2011-03-17T09:02:57Z")

</div>

For the life of me I can not get this to work properly. Every time I go to my URL I’m taken to a directory listing. I’ve configed all of the files. I’m probably missing something stupid simple. If anyone could help me out that would be amazing. Thanks. By the way, this looks amazing. I agree that the authorization from tre browser would be nice.

---

<div class="post-metadata">

**Author:** ![hd1080](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hd1080/32/2000_2.png) [@hd1080](https://forums.plex.tv/u/hd1080)\
**Post date:** [March 17, 2011, 7:46pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/27 "2011-03-17T19:46:21Z")

</div>

> [@](#):
>
> About multiples audio tracks with video, as far as i know, there is no html5 API implementation for audio selection. As transcoding is made by plex, i'll take a look to the next release API to see if we can choose audio track.  
>   
> @ hd1080:  
> If secure access is activate, you can't stream audio to your browser. I currently have an 'half' solution, which works with images and audio, but not with video stream.  
> Authentification problems are related about how PMS authentication is designed, it actually only accept http headers, which can't be directly sent by browsers (however, you'll be able to find plugins for those tasks).

I don’t have secure access enabled.  
  
  
  
Will you work on a solution to get the video via Direct Stream (live remuxing)? This would be rly nice to have.

> [@](#):
>
> For the life of me I can not get this to work properly. Every time I go to my URL I'm taken to a directory listing. I've configed all of the files. I'm probably missing something stupid simple. If anyone could help me out that would be amazing. Thanks. By the way, this looks amazing. I agree that the authorization from tre browser would be nice.

  
Did you try to open the http://yourip/plex\_over/env.php site?  
It will tell you if you have all plugins installed/enabled

---

<div class="post-metadata">

**Author:** ![branlr](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@branlr](https://forums.plex.tv/u/branlr)\
**Post date:** [March 19, 2011, 1:55am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/28 "2011-03-19T01:55:36Z")

</div>

Running this in xampp under win7x64…  
  
  
  
When I go to the root directory I get a sparse screen that shows a “movies” link… but anything I click on that links to the plex\_over directory prompts the following:  
  
  
  
  
  
“Access forbidden!  
  
  
  
You don’t have permission to access the requested object. It is either read-protected or not readable by the server.”  
  
  
  
curl enabled, short tags enabled, etc… Can’t figure it out. I saw reference to other people having issues like this but I didn’t see the solution.  
  
  
  
Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![sonotone](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sonotone](https://forums.plex.tv/u/sonotone)\
**Post date:** [March 19, 2011, 10:42am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/29 "2011-03-19T10:42:29Z")

</div>

> [@](#):
>
> Will you work on a solution to get the video via Direct Stream (live remuxing)? This would be rly nice to have.

  
  
Yeah, i'll take a look at this new feature.  
  
@branlr:  
It seem's this issue is related to your server's configuration.

---

<div class="post-metadata">

**Author:** ![IMacosiris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/imacosiris/32/367_2.png) [@IMacosiris](https://forums.plex.tv/u/IMacosiris)\
**Post date:** [March 19, 2011, 3:59pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/30 "2011-03-19T15:59:12Z")

</div>

Man can i say just , this is great !!!   
  
Is perfect !!!  
  
  
  
But i have some problems hope you can help me  
  
I have my PMS on my Mac with “OS X” OS version 10.6.6 Plex lasted version  
  
After enable the internet sharing to enable PHP install Safari and Quicktime in my Lenovo T400 with XP (is the machine from work)  
  
I could be able to connect and the menu and movies and tvshows appear  
  
But when i hit play, i only have the subtitle, no video , no sound.  
  
  
  
I try with the lasted version of firefox and a get and “X” on the Video and can’t play.  
  
  
  
What can i do ?  
  
  
  
Related to the install process feel like need more instructions  
  
Maybe in this two site you can get the steps to enable internet sharing and start PHP on OS X  
  
[http://fornoobs.info/2009/10/simple-installation-apache-mysql-php-on-snow-leopard/](http://fornoobs.info/2009/10/simple-installation-apache-mysql-php-on-snow-leopard/)  
  
[http://maestric.com/doc/mac/apache\_php\_mysql\_snow\_leopard](http://maestric.com/doc/mac/apache_php_mysql_snow_leopard)  
  
  
  
A good place to put Plex\_over is inside of user account /sites then you can call the site as http:///~/Plex\_over/index.php/  
  
  
  
Well thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![branlr](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@branlr](https://forums.plex.tv/u/branlr)\
**Post date:** [March 19, 2011, 4:20pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/31 "2011-03-19T16:20:58Z")

</div>

> [@](#):
>
> Yeah, i'll take a look at this new feature.  
>   
> @branlr:  
> It seem's this issue is related to your server's configuration.

  
  
How so?  
  
"Requirements:  
server side:  
  
 \* PHP 5.2 or newer  
 \* PHP-cURL  
 \* PHP short tags enabled\*  
 \* Plex Media Server running"  
  
  
All of these are true. How do you structure the htdocs/www folder? why the need to move the plex\_over folder? All directories should be accessible from the htdocs folder...  
  
Has anyone tested this under windows yet? (I am using it for my XBMC library, hence running it on windows)

---

<div class="post-metadata">

**Author:** ![saskwatch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/saskwatch/32/122877_2.png) [@saskwatch](https://forums.plex.tv/u/saskwatch)\
**Post date:** [March 19, 2011, 6:50pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/32 "2011-03-19T18:50:17Z")

</div>

I am not sure what I am doing wrong here. I have 2 scenarios.  
  
  
  
Scenario 1:  
  
  
  
I have a Mac-Mini running MAMP. I loaded plex\_over to the htdocs and configured as stated in the first post. I pull up safari and I am able to get the plex\_over site at [http://wan-ip](http://wan-ip):portnumber/plex\_over. I am able to browse my libraries and I am able to get a video to stream and download. Yay!!!  
  
  
  
Scenario 2:  
  
  
  
I went to a different PC and tried to access plex\_over at [http://wan-ip](http://wan-ip):portnumber/plex\_over and I get problems. The movie posters never show up for any of my moviies. Using Safari, I can not stream a movie; however I can download the movie. What gives?  
  
  
  
Why does this work when running from the web/plex server, but not on a different machine on my network? I think I am using the build of plex\_over from 3/14/2011.

---

<div class="post-metadata">

**Author:** ![saskwatch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/saskwatch/32/122877_2.png) [@saskwatch](https://forums.plex.tv/u/saskwatch)\
**Post date:** [March 19, 2011, 8:43pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/33 "2011-03-19T20:43:49Z")

</div>

> [@](#):
>
> I am not sure what I am doing wrong here. I have 2 scenarios.  
>   
> Scenario 1:  
>   
> I have a Mac-Mini running MAMP. I loaded plex\_over to the htdocs and configured as stated in the first post. I pull up safari and I am able to get the plex\_over site at http://wan-ip:portnumber/plex\_over. I am able to browse my libraries and I am able to get a video to stream and download. Yay!!!!  
>   
> Scenario 2:  
>   
> I went to a different PC and tried to access plex\_over at http://wan-ip:portnumber/plex\_over and I get problems. The movie posters never show up for any of my moviies. Using Safari, I can not stream a movie; however I can download the movie. What gives?  
>   
> Why does this work when running from the web/plex server, but not on a different machine on my network? I think I am using the build of plex\_over from 3/14/2011.

  
  
I figured out most of this. I needed to change the PUBLIC URL in the user\_pref to my WAN IP:portnumber. I get all of my art in the navigation, and it is all beautiful. The problem that I am having now is that it will not stream on the other computers. I am using Windows 7 and Safari. It acts like it wants to stream, but never quite makes it. Any ideas?

---

<div class="post-metadata">

**Author:** ![saskwatch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/saskwatch/32/122877_2.png) [@saskwatch](https://forums.plex.tv/u/saskwatch)\
**Post date:** [March 19, 2011, 9:15pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/34 "2011-03-19T21:15:05Z")

</div>

> [@](#):
>
> Ratio should be fixed now with latest sources on github.  
> It will works with safari on windows, however you need to install quicktime to play medias (or use Chrome, which can play h264 / mp3 codecs).  
> Transcoding seem's to not works on safari windows.  
>   
> At the moment, i'm little bit stuck with video. I think we have to wait next PMS update and take a look on transcoding API, which seem's not finalized right now.  
> A possible trick (for non h264 codecs) is to copy video link then play it with VLC, or install perian (osx only), but this is not really "bandwitch friendly".

  
  
So I studied the thread more closely and I have hit the wall with Windows. You mentioned that Chrome on Windows will play the files. Can you elaborate more? I have tried this with Chrome, and the video streaming does not work.

---

<div class="post-metadata">

**Author:** ![wally007](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wally007](https://forums.plex.tv/u/wally007)\
**Post date:** [March 19, 2011, 9:52pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/35 "2011-03-19T21:52:15Z")

</div>

> [@](#):
>
> So I studied the thread more closely and I have hit the wall with Windows. You mentioned that Chrome on Windows will play the files. Can you elaborate more? I have tried this with Chrome, and the video streaming does not work.

  
  
I dont think Chrome will play files m3u files. We either have to wait for Google to start supporting it (unlikely) or Plex devs enable Web manager to generate flash streams

---

<div class="post-metadata">

**Author:** ![joesoes](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/joesoes/32/1658_2.png) [@joesoes](https://forums.plex.tv/u/joesoes)\
**Post date:** [March 21, 2011, 12:45pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/36 "2011-03-21T12:45:11Z")

</div>

Sorry for the stupid question, but how do i configure the files?  
  
  
  
The wiki says:

```auto

In root folder, you'll find a subfolder "plex_over/config"<br />
Open config.php, then set:<br />
$config['base_url'] = "plex_over url";<br />
$config['language'] = "english" or "french";<br />
<br />
localization files are available in plex_over/languages. Feel free to submit your own.<br />
More infos about Codeigniter configuration: http://codeigniter.com/user_guide/installation/index.html<br />
<br />
Open user_pref.php, then set:<br />
$config['plex_local'] = "Plex media server access for plex_over";<br />
$config['plex_url'] = "Plex media server access browsers";

```

  
  
Could someone give me an example please?

---

<div class="post-metadata">

**Author:** ![IMacosiris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/imacosiris/32/367_2.png) [@IMacosiris](https://forums.plex.tv/u/IMacosiris)\
**Post date:** [March 22, 2011, 1:13am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/37 "2011-03-22T01:13:35Z")

</div>

> [@](#):
>
> Sorry for the stupid question, but how do i configure the files?  
>   
> The wiki says:  
>   
> 
> ```auto
> 
> In root folder, you'll find a subfolder "plex_over/config"<br />
> Open config.php, then set:<br />
> $config['base_url'] = "plex_over url";<br />
> $config['language'] = "english" or "french";<br />
> <br />
> localization files are available in plex_over/languages. Feel free to submit your own.<br />
> More infos about Codeigniter configuration: http://codeigniter.com/user_guide/installation/index.html<br />
> <br />
> Open user_pref.php, then set:<br />
> $config['plex_local'] = "Plex media server access for plex_over";<br />
> $config['plex_url'] = "Plex media server access browsers";
> 
> ```
> 
>   
>   
> Could someone give me an example please?

  
  
  
Hope this help  
  
I put the plex\_over in my user/sites  
Enable WEB Sharing and do the config to enable PHP (check up in this page i put the URL with instructions to config PHP Server)  
  
in config.php  
$config['base\_url'] = "http://192.168.1.100/~pcarbonel/Plex-over";  
  
In user\_pref.php  
  
\*/  
// the PRIVATE url of the Plex Server (no trailing slash !!!!)  
// Used to retreive xml files. If your running plex server on same  
// host, prefer localhost (no name/dns resolution required = faster)  
$config['plex\_local'] = 'http://192.168.1.100:32400';  
// the PUBLIC url of the Plex Server (no trailing slash !!!!)  
// used in frontend for downloads and images  
$config['plex\_url'] = 'http://192.168.1.100:32400';  
  
Then on safari  
http://192.168.1.100/~pcarbonel/Plex-over/index.php/  
  
And... voala!  
  
BUT and is a BIGGG BUT  
Is not work on SAFARI with Windows XP  
The developer don't give any clue

---

<div class="post-metadata">

**Author:** ![sonotone](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sonotone](https://forums.plex.tv/u/sonotone)\
**Post date:** [March 22, 2011, 3:57pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/38 "2011-03-22T15:57:15Z")

</div>

> [@](#):
>
> BUT and is a BIGGG BUT  
> Is not work on SAFARI with Windows XP  
> The developer don't give any clue

  
  
What is exactly not working?  
  
Just to clear up browsers support:  
- Transcoding only works on safari / osx-ios (m3u8 format)  
- Mp3 can be read by Safari, chrome and IE9  
- h264 videos can be played by Chrome (but they drop support on latest releases) and IE9

---

<div class="post-metadata">

**Author:** ![IMacosiris](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/imacosiris/32/367_2.png) [@IMacosiris](https://forums.plex.tv/u/IMacosiris)\
**Post date:** [March 22, 2011, 4:35pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/39 "2011-03-22T16:35:49Z")

</div>

> [@](#):
>
> What is exactly not working?  
>   
> Just to clear up browsers support:  
> - Transcoding only works on safari / osx-ios (m3u8 format)  
> - Mp3 can be read by Safari, chrome and IE9  
> - h264 videos can be played by Chrome (but they drop support on latest releases) and IE9

  
  
Ok, in my config  
Windows XP SP3  
Safari 5.0.4 (7533.20.27)  
Quicktime Version 7.69  
Bonjour version installed by safari  
  
Menu appear OK  
When i hit play on a TV Show, the wheel spins, but i got no video, audio or subtitle.  
I try with a TV show in a .m4v and .avi format , no success  
  
On OSX where plex is runing (Plex version 9.2.5)  
  
Plex over environnement checker  
  
php\_version: current is 5.3.4  
mod\_rewrite: rewrite engine is enabled  
short\_open\_tag: enabled  
php\_curl: version 7.19.7 installed

---

<div class="post-metadata">

**Author:** ![HaveACoke1886](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@HaveACoke1886](https://forums.plex.tv/u/HaveACoke1886)\
**Post date:** [March 24, 2011, 1:22am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/40 "2011-03-24T01:22:14Z")

</div>

I got everything working locally on my Mac. When I am away using a Windows computer, I have tried Firefox 4, IE9, Chrome 11 and Safari 5.0.4; and IE9 and Chrome are the only ones that display the video player, and it won’t play. Plex shows active transcoding sessions when I hit the play button. Is it just because it is a Windows client?

[Previous page](https://forums.plex.tv/t/php-client-for-plex-media-server/8049.md?page=1)

[Next page](https://forums.plex.tv/t/php-client-for-plex-media-server/8049.md?page=3)
