TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Virtual Directory Support? (http://www.talkphp.com/general/2736-virtual-directory-support.html)

delayedinsanity 04-29-2008 05:11 PM

Virtual Directory Support?
 
So I spend all morning adding stupid DEBUG hacks to my web site so that I can have it run on my current server, albeit not the way I wanted it to, as close to it as possible.

Not only did I have to mess with my directory structure because locally I have it set up under the document root, and thanks to some a$$h*le company called Verio front running the domain I wanted for it I have it set up remotely as a sub domain of my other site... but as I mentioned elsewhere mod_rewrite isn't enabled so I had to go through and add the little .php extension here and there and.... OH BUT GUESS WHAT??!

So, you know how this should work fine, right?

http://host/index.php/this/still/loads/index.php

Ie, it loads index.php and everything after is just ignored (unless of course you explode your path and use it as input like I theoretically was going to do...). WELL. Not only does my dumbass, we've been on the internet for 15+ years and still don't know a damned thing host not have mod_rewrite enabled, apparently they've managed to do something to Apache to disable that from working too. If I go to...
http://remotehost/index.php/anythinghere

...it just loads, and loads until the connection times out.

I know this doesn't have much to do with PHP but I don't feel like joining talkapache.com just to ask. I can't figure out how they managed to screw that one up, except for one setting in phpinfo() I spotted.

Virtual Directory Support enabled

It's enabled on mine, disabled on theirs, and no matter how much you google it, for some reason even apache.org doesn't tell you what it does. Anybody know if that's my problem?
-m

TlcAndres 04-29-2008 07:33 PM

While I can't be sure if it's a solution to your problem you could use $_SERVER['REQUEST_URI'] to see if theres something after index.php and if there is relocate them to the desired page...here

PHP Code:

function detect(){
  
$uri end(explode('/',$_SERVER['REQUEST_URI']));
  if(
$uri != '' xor $uri !='index.php')
  {
     
header("Location: http://google.com");
  }


Again don't know exactly what you want.

delayedinsanity 04-29-2008 08:38 PM

I already use REQUEST_URI except it's more like this;

PHP Code:


// globally clean the data
if ($_POST$this->objForm->sanitize();

// determine course of action
$this->command explode("/"$_SERVER['REQUEST_URI']);

// bullshit I need because I'm using a sub-domain
if (DEBUG_LOCALarray_shift($this->command);

// I need 3 and 4 in some cases further on in the class, so I sacrifice some readability instead of using end()
switch ($this->command[3]) {
    case 
"join"     $this->procRegister(); break;
    case 
"verify"   $this->procVerify(); break;
    case 
"login"    $this->procLogin(); break;
    case 
"forgot"   $this->procForgotPass(); break;
    case 
"remember" $this->procRemember(); break;
    default         : 
$this->procLogout();


Locally, if I type in http://localhost/index.php and if I type in http://localhost/index.php/blah/ it'll still load index.php and the server just ignores everything after index.php. In other worsds, by exploding REQUEST_URI, I can use the information after index.php as a form of data input. This is how I process my UAC calls. The links say /users/process/login/ or /users/process/register/, but technically they're all going to process.php, and everything after process is used to determine what process.php should be doing.

It works just fine on my very default set up of apache locally. It doesn't work on my host. Doesn't work here either, so I don't have a physical example to show you, but I'm sure the person who can help me should understand what I'm saying, I hope. ;-)
-m

taurusweb 01-15-2011 11:05 AM

Virtual Directory Support
 
Locate your php.ini file in your server and search for the entry virtual Directory Support and check it is enabled, If not enable it.

Virtual Directory Support => enabled

Sachin
Visit us on - <removed>

robsand 11-08-2012 09:04 PM

I located my php.ini and can not see an entry for Virtual Directory Support; yet I see that it is set do DISABLED at http://localhost/phpinfo.php.

What is the setting called in PHP.ini?


All times are GMT. The time now is 11:07 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0