icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » proc_open.... trying to execute a php file like an include()

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old August 23rd, 2008, 4:02 AM   #1 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
163 posts
Gave thanks: 4
Thanked 5 times
Send a message via AIM to Gamer.Saga
proc_open.... trying to execute a php file like an include()

The scenario is, I want to make proc_open() work like include().... I need to have access to all the variables like $_GET, $_POST, $_SERVER, $_REQUEST, $HTTP_SERVER_VARS, and what not. I don't want it to have any call back to the functions that I'm executing it from, I know that's an unlikely scenario to happen. I can't find any information on how apache does it.... at all... I think I might have to use "php -a" to make it happen, but I don't want to really do that.. Any help with this would be great.... Btw, before someone suggests using some other function, the reason I need to use proc_open(), is because I'm trying to emulate multi-threading.

Thanks in advanced.
__________________
HD.C | MyTwitter
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 25th, 2008, 1:37 PM   #2 (permalink)
Surpass Developer
Excelling Contributor
 
Mark's Avatar
 
Joined in Jan 2004
Lives in Florida
Hosted on core.surpasshosting.com
731 posts
Gave thanks: 32
Thanked 96 times
the manpage for proc_open has an example which I believe is doing sort of what you need to do:

PHP: proc_open - Manual

Check example #1. You can put $_GET,$_POST inside $env:

PHP Code:
$env = array('POST' => $_POST'GET' => $_GET); 
and then call them inside the script you are executing with proc_open, like:
PHP Code:
$_ENV['POST']['some_post_var'
It is a round about way to do it, but i think it should work
__________________
Mark
Surpass Hosting Developer
ǝɹnʇɐubıs ʎɯ ǝ1oʇs xǝ1ɐ
Mark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 26th, 2008, 3:05 AM   #3 (permalink)
php, wha?!
Comfy Contributor
 
Gamer.Saga's Avatar
 
Joined in Feb 2008
163 posts
Gave thanks: 4
Thanked 5 times
Send a message via AIM to Gamer.Saga
I find everything that I put into $env to be unreliable. I've gotten only the first letter from everything I've had in my $_GET array before. I pretty much just came to the conclusion I need to figure out how to pass on the data that apache passes on to php, in the exact same way. Which, I can't read through C++, so I have no idea how this works, and no one else seems to either. I'm about to just give up and go ruby.
__________________
HD.C | MyTwitter
I am addicted to LINUX.
Gamer.Saga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On