Closed Thread Icon

Preserved Topic: calling a .pcgi from a .php page (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=21106" title="Pages that link to Preserved Topic: calling a .pcgi from a .php page (Page 1 of 1)" rel="nofollow" >Preserved Topic: calling a .pcgi from a .php page <span class="small">(Page 1 of 1)</span>\

 
butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 04-28-2002 22:10

I want to know how to either call a .pcgi page from a php page as a .pcgi file, or make a .pcgi page able to accept and pass on php session variables.

I have a php script with a call to the exec() function to unzip .zip files that have been uploaded to the server. Because of the security precautions that Dreamhost takes, I can't use the exec() function unless it's called as a .pcgi page. I tried including it as a .pcgi page in my php script, but I still get an error message saying the exec() function has been disabled for security reasons which causes me to assume that the pcgi include is being run as a .php file because it is included in one.

If I just change my php page to a pcgi page, I lose my session handling.

I would appreciate any suggestions on how to solve this. Also, if there is another way to unzip a zip file on the server without using the exec() function (or anything like it that Dreamhost doesn't allow) I would be grateful.

Thanks

-Butcher-

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-28-2002 22:18

well, you could in theory store the sessionID in a post variable to the pcgi, unzip, and then redirect to php page, passing the SessionID as a get.
That way you could keep the session handling...

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 04-29-2002 01:59

Hmm, couldn't you just make all of the pages .pcgi files? That way they'd all be running as the same user (you), and they would have the same session IDs. I haven't experimented with this, but it should work, .php and .pcgi are both PHP, just with different users. Do them all the same and all should be fine, I'd think. If you don't want to have to change all the file names, you can use .htaccess to force .php files to run as .pcgi, this is from the knowledgebase files...

"TO HAVE A SCRIPT RUN AS PHP-CGI, simply rename the script so that it ends in .pcgi instead of .php.

If you have lots of files you don't want to rename, and are sure that all files named .php should be run as PHP-CGI, you can make an .htaccess file containing this:

AddType php-cgi .php "

See https://kbase.newdream.net/index.cgi?area=2526 for more.

Your pal, -doc-



[This message has been edited by DocOzone (edited 04-29-2002).]

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 04-29-2002 22:56

Thanks Doc

The htaccess idea will work very nicely.

It sounds so easy when you say it... but the thought of changing them all to .pcgi never even crossed my mind!



-Butcher-

« BackwardsOnwards »

Show Forum Drop Down Menu