36240

How to enable the Virtual Directory Support php?

I see "Virtual Directory Support" is disabled in phpinfo.php, how can I enable it ?

Answer1:

In short: You can't easily. And you should not.

Longer story: PHP is supposed to provide a shared nothing environment. In this context this means if two scripts are running in parallel they should not interfere. In most cases this is no issue as different scripts use different processes. (Apache module with mod_prefork, FastCGI, fpm, ...) But in some scenarios people use PHP as a module in a threaded environment. (Microsoft IIS module, Apache mod_mpm module etc.) If that is the case PHP can't rely on the operating system to separate context but has to do it itself. One relevant area is the current working directory. The option you mentioned is about that and the name is misleading: It is not "Virtual Directory Support" but "Virtual Current Working Directory Support". It is an abstraction for file system operations. So when having two PHP requests in different threads and code like include "./foo.php"; you want that to be relative to the requests main script and not the global state of the environment. VCWD support does that. As it is only relevant for threaded environments enabling/disabling is bound to the setting whether PHP is built thread safe or not, which is done at compile time. Unless you need to this is of. As a user you shouldn't care about it - it is not related to the ability to use streams or something from your PHP script.

Answer2:

Compiling with --enable-maintainer-zts should do it. But make sure you know what it does, here is an explanation.

Recommend

  • .htaccess - execute PHP in .html files on FastCGI
  • How can I find out what's going wrong with a ddev container, or see the logs?
  • Best practice to handle default server and ip forwarding in nginx
  • php mail() function and IIS
  • Rails : post-processing a rendered view
  • How to rotate text with view using OpenLayers 3
  • Setting php.ini variables inside web.config on IIS 7.5
  • TTS *and* Speech Input simultaneously?
  • Can't run multiple batch files sequentially from master batch file in Win7
  • php cannot connect to mysql in docker-compose
  • How to navigate between different html pages in Windows 8 Metro application using javascript?
  • How atomic are mongoengine's operations
  • Laravel routes not found on nginx
  • Implementation of monitors with semaphores
  • Running exec() command with dev>null & doesn't work, but dev>null does
  • PHP Queue System with Codeigniter. HOW? [closed]
  • User matching with current data
  • writing file in heroku filesystem and reading it with web app
  • Debug PHP in Atom While Using Vagrant
  • What is the difference between Socket.Send and Stream.Write? (in relation to tcp ip connections)
  • Unable to get CAP_CHOWN and CAP_DAC_OVERRIDE working for regular user
  • How to start server for Selenium grid Java Maven setup
  • Detection of framework usage on Mac system?
  • crash in __tcf_0
  • File extension of zlib zipped html page?
  • iOS Cordova first plugin - plugin.xml to inject a feature
  • For loop with if condition on multiple R functions
  • How do I exclude a dependency in provided scope when running in Maven test scope?
  • Is there a perl module to validate passwords stored in “{crypt}hashedpassword” “{ssha}hashedpassword
  • Problem deserializing objects from cache on MyBatis 3/Java
  • Content-Length header not returned from Pylons response
  • Meteor helpers not available in Angular template
  • Cannot connect to cassandra from Spark
  • Display issues when we change from one jquery mobile page to another in firefox
  • Different response to non-authenticated users and AJAX calls
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • Data Validation Drop Down Box Arrow Disappearing
  • PHP: When would you need the self:: keyword?
  • How to include full .NET prerequisite for Wix Burn installer
  • using HTMLImports.whenReady not working in chrome