# 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:** 1

<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:** [February 27, 2011, 6:45pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/1 "2011-02-27T18:45:29Z")

</div>

early preview of Plex Over
Hi,   
  
I'm currently working on a little php application witch allow you to access to Plex Media Server and watch, listen or download your medias.  
t's far to be finished, but i think it will be a good think to share this now, to track bugs, have feedbacks, suggestions and ideas... etc.  
  
You'll find to source code and instructions on Github: https://github.com/ronan-gloo/plex-over  
  
Please, report issues or suggestions on Github.  
  
![post-33494-0-12452400-1346334843.png|500x360](upload://sATTsFSFjswGgxReAEvmQ7RZdEL.png)  
![post-33494-0-82864800-1346334865.png|500x301](upload://zPMXCrVH4UPukQYyPndYD81NRFZ.png)  
![post-33494-0-80560000-1346334880.png|500x317](upload://vLYYbF4emRx35LmQQ1bbqZ1EIa7.png)

---

<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:** [February 27, 2011, 9:40pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/2 "2011-02-27T21:40:31Z")

</div>

Looks really nice. Cant wait till I can use this via Chrome/FireFox. ( Safari is not allowed in our company )

---

<div class="post-metadata">

**Author:** ![barrycraig](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/barrycraig/32/894_2.png) [@barrycraig](https://forums.plex.tv/u/barrycraig)\
**Post date:** [February 27, 2011, 10:02pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/3 "2011-02-27T22:02:00Z")

</div>

fantastic!

---

<div class="post-metadata">

**Author:** ![tester22](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tester22](https://forums.plex.tv/u/tester22)\
**Post date:** [March 1, 2011, 7:58pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/4 "2011-03-01T19:58:59Z")

</div>

Couldn’t get this to work.  
  
Tried on both stock apache with upgraded php and MAMP but when I tries to open the page in a browser I get redirected to an error 403 page at: http:///plex-over/library/sections  
  
And this is what I can see in the log:  
  
[Tue Mar 01 20:52:51 2011] [notice] Apache/2.0.63 (Unix) PHP/5.3.2 DAV/2 configured – resuming normal operations  
  
[Tue Mar 01 20:52:58 2011] [error] [client ::1] File does not exist: /Applications/MAMP/htdocs/plex-over/library  
  
  
  
Tried to disable apc but that didn’t work. Any ide about what might be wrong.

---

<div class="post-metadata">

**Author:** ![aalsg0tt](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@aalsg0tt](https://forums.plex.tv/u/aalsg0tt)\
**Post date:** [March 1, 2011, 8:48pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/5 "2011-03-01T20:48:52Z")

</div>

Probably the same issue: I tried running this on my Synology DS409 but I’m getting a “Page not found” after being redirected to http:///plexover/library/sections  
  
  
  
Great project though!

---

<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 2, 2011, 4:52pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/6 "2011-03-02T16:52:33Z")

</div>

You may have to rename htaccess.txt to .htaccess for apache directives.  
  
In this file, there is rewrite rules to skip ‘index.php’ in url string. If Plex Over is not the host (ie: [http://host/sub\_folder/](http://host/sub_folder/)), you have to change this line (6):

```auto

RewriteRule ^(.*)$ index.php/$1 [L]

```

  
to  

```auto

RewriteRule ^(.*)$ /sub_folder/index.php/$1 [L]

```

  
  
The "home page" is not really done yet, use sidebar to navigate in sections instead.  
  
Let me know if it's ok.

---

<div class="post-metadata">

**Author:** ![tester22](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tester22](https://forums.plex.tv/u/tester22)\
**Post date:** [March 2, 2011, 6:39pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/7 "2011-03-02T18:39:31Z")

</div>

works, now.

---

<div class="post-metadata">

**Author:** ![aalsg0tt](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@aalsg0tt](https://forums.plex.tv/u/aalsg0tt)\
**Post date:** [March 2, 2011, 8:54pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/8 "2011-03-02T20:54:34Z")

</div>

> [@](#):
>
> Let me know if it's ok.

  
Perfect, 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 4, 2011, 7:05am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/9 "2011-03-04T07:05:03Z")

</div>

So i just got this installed and all i have to say is wow, this is really something very cool. However just noticed something to report. Line 18 and 23 in your thumbs.php file cause errors in my browsers commenting them out appears to do nothing and causes the program to work without errors, dont know what the lines are actually supposed to do so i dont know if im missing a feature. The next thing i noticed is if the video is in the windowed mode the aspect ratio is 100% correct, however when you move to full screen mode the aspect ratio is forced into some form of what appears to be 2.39:1 which is great for some movies but for 16:9 tv shows and 16:9 movies and 4:3 tv shows it causes horrid stretching. Again thanks for this awesome piece of software. Please let me know if there is a fix for either of these problems.

---

<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 4, 2011, 5:24pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/10 "2011-03-04T17:24:19Z")

</div>

> [@](#):
>
> Line 18 and 23 in your thumbs.php file cause errors in my browsers commenting them out appears to do nothing and causes the program to work without errors, dont know what the lines are actually supposed to do so i dont know if im missing a feature.

  
It actually do nothing usefull :). I just forgot to remove this class when loading plex over.  
You can modify config/autoload.php like this one (line 41): https://github.com/ronan-gloo/plex-over/blob/c17a5df7fb961eeaa5d746a94e6a8ccb1ff44b1b/plex\_over/config/autoload.php   
This will stop to load thumb.php.  

> [@](#):
>
> The next thing i noticed is if the video is in the windowed mode the aspect ratio is 100% correct, however when you move to full screen mode the aspect ratio is forced into some form of what appears to be 2.39:1 which is great for some movies but for 16:9 tv shows and 16:9 movies and 4:3 tv shows it causes horrid stretching. Again thanks for this awesome piece of software. Please let me know if there is a fix for either of these problems.

  
It's only happens when you're trying to watch a tv-show right?  
I'll fix this, the video player force width/height, and switching to fullscreen keeps this ratio.  
  
Thank for your feedback.  
  
@denisb88  

```auto

An Error Was Encountered<br />
Message PMS:<br />
<br />
http://localhost:324...brary/sections/

```

  
Ok, translation is missing, but this means that there is no plex media server at http://localhost:32400. (you have to indicate your ip or a domain if PMS is on another host).  
Check comments at the end of this file: https://github.com/ronan-gloo/plex-over/blob/alpha/plex\_over/config/user\_pref.php  
  
think i'll disable url rewriting by default, is not that easy for everybody to configure. And don't worry, documentation will be available soon.

---

<div class="post-metadata">

**Author:** ![phindus](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@phindus](https://forums.plex.tv/u/phindus)\
**Post date:** [March 5, 2011, 4:07pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/11 "2011-03-05T16:07:24Z")

</div>

Can we not just stay to English in the main part of the forum? A little bit hard to follow the progress in here and this really seems interesting.  
  
  
  
[hr]Agreed, topic split. French posts moved [here](http://forums.plexapp.com/index.php/topic/24104-php-client-for-plex-media-server-french/).  
  
[hr]

---

<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 5, 2011, 8:09pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/12 "2011-03-05T20:09:05Z")

</div>

> [@](#):
>
> It actually do nothing usefull :). I just forgot to remove this class when loading plex over.  
> You can modify config/autoload.php like this one (line 41): https://github.com/ronan-gloo/plex-over/blob/c17a5df7fb961eeaa5d746a94e6a8ccb1ff44b1b/plex\_over/config/autoload.php   
> This will stop to load thumb.php.  
>   
> It's only happens when you're trying to watch a tv-show right?  
> I'll fix this, the video player force width/height, and switching to fullscreen keeps this ratio.  
>   
> Thank for your feedback.  
>   
> @denisb88  
> 
> ```auto
> 
> An Error Was Encountered<br />
> Message PMS:<br />
> <br />
> http://localhost:324...brary/sections/
> 
> ```
> 
>   
> Ok, translation is missing, but this means that there is no plex media server at http://localhost:32400. (you have to indicate your ip or a domain if PMS is on another host).  
> Check comments at the end of this file: https://github.com/ronan-gloo/plex-over/blob/alpha/plex\_over/config/user\_pref.php  
>   
> think i'll disable url rewriting by default, is not that easy for everybody to configure. And don't worry, documentation will be available soon.

  
  
  
can you let us know when you push the update for the aspect ratio so i can download the updated version. Also do you know if this is suppose to work in Safari on windows as well or does it only work on safari for mac?  
thank you again

---

<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 5, 2011, 9:21pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/13 "2011-03-05T21:21:49Z")

</div>

> [@](#):
>
> can you let us know when you push the update for the aspect ratio so i can download the updated version. Also do you know if this is suppose to work in Safari on windows as well or does it only work on safari for mac?  
> thank you again

  
  
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".

---

<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 6, 2011, 1:22am UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/14 "2011-03-06T01:22:17Z")

</div>

looking at the screenshots, download button downloads original file or transcoded file? would be cool if we could download transcoded file, as even with 2mb upload original HD files take forever to download )

---

<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 6, 2011, 12:14pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/15 "2011-03-06T12:14:44Z")

</div>

> [@](#):
>
> looking at the screenshots, download button downloads original file or transcoded file? would be cool if we could download transcoded file, as even with 2mb upload original HD files take forever to download )

  
  
Downloads are original files. Downloading transcoded movie is not possible like this, cause movie is segmented into multiple parts as you're playing it.  
However, it's still possible to run ffmpeg command from Plex Over, convert movie into a reasonable size, then send link to the browser.

---

<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 6, 2011, 2:16pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/16 "2011-03-06T14:16:04Z")

</div>

> [@](#):
>
> Downloads are original files. Downloading transcoded movie is not possible like this, cause movie is segmented into multiple parts as you're playing it.  
> However, it's still possible to run ffmpeg command from Plex Over, convert movie into a reasonable size, then send link to the browser.

  
  
  
Supposedly Klexi ( an iOS app ) allows downloading transcoded media without playing it first.  
  
I've tried it once and while it did download the movie fine, Klexi itself was not very stable (granted that was many moons ago) so I began using Plex iOS.

---

<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 7, 2011, 9:38pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/17 "2011-03-07T21:38:40Z")

</div>

I have a question, did you think about maybe rewriting your app in cappuccino its the framework that the media viewer for the server is based in and it might not be that hard of a port? The benefits though would be that you could get a much more webapp like feel than you have now which may be nice.

---

<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 8, 2011, 10:08pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/18 "2011-03-08T22:08:54Z")

</div>

> [@](#):
>
> I have a question, did you think about maybe rewriting your app in cappuccino its the framework that the media viewer for the server is based in and it might not be that hard of a port? The benefits though would be that you could get a much more webapp like feel than you have now which may be nice.

  
  
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.

---

<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 9, 2011, 10:40pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/19 "2011-03-09T22:40:29Z")

</div>

I have to say this is rly ■■■■■■■ awesome work 😉 :thumpsup:  
  
It works almost perfect for me.  
  
  
  
Some of my movies have two audio tracks and it would be nice if I could switch between them.  
  
When the movie gets transcoded does it encode all audio tracks or do you select the first one?  
  
It would be fine for me if I can select the Audio Track before I start streaming the movie.  
  
  
  
Another Problem I have is that I cant stream music.  
  
I just get 404 Page not found. My URL in broswer is [http://myip/plex\_over/index.php/music/iTunes](http://myip/plex_over/index.php/music/iTunes). Is this correct so?  
  
I have to say that the webserver is not running on the same machine as PMS is running.

---

<div class="post-metadata">

**Author:** ![lauridsd](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@lauridsd](https://forums.plex.tv/u/lauridsd)\
**Post date:** [March 9, 2011, 11:10pm UTC](https://forums.plex.tv/t/php-client-for-plex-media-server/8049/20 "2011-03-09T23:10:39Z")

</div>

I always get

```auto

Directory access is forbidden.

```

  
Any idea?  
  
Edit: Works now..  
  
But i've found another Problem.. Movies/Epidsodes with Dual Audio play both tracks at the same time (AVI plays both, MKV just the first one)

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