AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
11/22/2024 - 10:30 PM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
Cannot get GD2 on PHP to work on AbelCam web server
By: RaleighMu
Rank: Frequent User
Topics: 24
From: USA
Added: 07/31/2010 - 02:23 PM

This is not a critical issue.

I have installed version 5.3.3 of PHP5 as directed in the documentation (unzipped into directory c:/php and used the suggested AbelCam template for php.ini). PHP appears to be running fine with AbelCam 3.2.3. However, I've installed a third party PHP script which does a hyperlinked directory listing (no index.html file required) in order to dynamically display all of my motion captured jpegs which I put in a separate directory. That script is basically working fine and can be found here:

http://www.evoluted.net/community/code/directorylisting.php

The only problem I have is that the script says that automatic thumbnail generation requires gd2 and I can't seem to get that to work on my rig. I can click on each file and it opens nicely, but the demo of the script shows that a mouseover will display a pop-up thumbnail which would be very nice for me.

AbelCam documentation does say that PHP is only partially supported, so this is NOT a complaint. However, I have been knocking myself out by modifying my php.ini file (the AbelCam version) and will stop my efforts if external modules, or just gd2, just aren't supported.

Here is what I've done to the php.ini file (these two line were originally made invisible as comments):

extension_dir="c:\php\ext\"
extension=php_gd2.dll

I've actually tried every possible value of extension_dir to no avail. What SHOULD happen is that php should find php_gd2.dll in the extension_dir directory and all will be well.

When I run phpinfo.php there are no modules listed and the following line is a mystery to me:

extension_dir => C:\php5 => C:\php5

Any thoughts on this? Anyone else doing extensive php work with AbelCam? I'm actually VERY pleased that basic php is working and will help me solve a lot of other problems.

Is it worth just setting up Apache and use that on another port to serve up that directory?

St. Louis, Missouri, USA
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 08/03/2010 - 03:01 PM

By downgrading to PHP 4.4.6 all the $_GET and $_REQUEST stuff started working as expected again. So at least I know now that I haven't lost my mind in regard to my old code working at one time, GETs and all...

The script originally being discussed in this thread still doesn't work right because of CLI's non-outputting of headers. See this:
http://www.php.net/manual/en/features.commandline.differences.php
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 08/04/2010 - 12:39 PM

For using PHP 5.x with AbelCam please see this post on the Issue Tracker:

http://www.abelcam.com/en/membersonly/issues/344#i19

I got it all sorted out, except for the matter of PHP returning headers to AbelCam and AbelCam passing them along unmolested.
By: SeanGa
Rank: Frequent User
Topics: 15
From: n/a
Added: 08/11/2010 - 02:45 AM

Adding my opinion to the mix. I found the AbelCam webserver has limited support for some PHP applications due to the way it handles post/get variables as well. As I tried to pull together some open-source PHP scripts that do something similar to what RaleighMu is doing.

see it here:
http://www.abelcam.com/Members/SeanGa

I found installing certain PHP applications would work great out of the box on my Apache server without tweaking. But moving them over to the AbelCam webserver became problematic. Tweaks required.

Is there any reason why Apache couldn't replace the Abelcam webserver? I know AbelCam heavily uses SSI and other stuff on the server side, but couldn't this be replaced with a PHP call to SHELL_EXEC or other way to hack into the AbleCam routines that are needed? Maybe creating an Apache MOD_ABELCAM would be the cleanest way of doing it.

It would be easier for PHP developers to add functionality to the product if these Abelcam api's could be hooked from native PHP and native Apache installs. The defacto-standard for most PHP apps.

I've abandoned trying to add much more functionality into my little Abelcam project due to these snags. I find a cool PHP app that I want to integrate, but then I can't get it to work on the Abelcam webserver.

All in all - the product does what it promises and I love the idea that it can be extended and pliable using PHP. I just find the current web and PHP implementation problematic.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 08/11/2010 - 07:13 AM

Lots of PHP discussion happening on the Issue Tracker this week.

Sean, if you are using PHP 5 you will get much better behaviour from GET and REQUEST and releated variables by using the PHP CGI rather than the CLI. You can do this either be renaming "pgp_cgi.exe" to "php.exe" or use the new "pick your interpreter" config item in the latest Beta to make AbelCam use php_cgi.exe.

One big underlying cause of problems is that until now AbelCam has just assumed that php.exe is the correct (CGI) flavor of the interpreter to use. That was fine under PHP 4. For whatever reason, the folks at PHP changed things for PHP 5: the default php.exe is no longer the right one for AbelCam.

Regarding Apache integration... I dunno, sounds like a major change. My solution to the situation you described is to run Apache + PHP to handle all things that are not uniquely AbelCam. The pages served by Apache+PHP contain references to AbelCam (running on a different port) where things like video streams and PTZ controls appear. Works for me, but then I am not one to shy away from writing what I need if it isn't there out of the box.