How to make symbolic links to windows with mod_php?

I am trying to use symbolic links to Windows 7 from PHP. I am running XAMPP with Apache 2.4.10 and PHP 5.5.15 from a regular user account (non-admin). As suggested in Symlink does not work on my local computer I set the correct permissions for my user to create symbolic links. This works fine, I can create symlinks ( mklink ...) from the command line without raising. The PHP function symlink()does not issue any permissions (code 1314).

When starting PHP from the command line or when loading via CGI, everything works as expected:

  • symlink() able to create symbolic links (absolute and relative target paths)
  • is_link() returns true for symbolic links
  • filetype() returns a link for symbolic links

However, when I run PHP as an apache module, I run into all the troubles:

  • symlink()It can only create symbolic links, when the target is a valid absolute circuit (using relative paths: Warning: symlink(): Could not fetch file information(error 2))
  • is_link()returns false for symbolic links
  • filetype()returns 'file' / 'dir' for symbolic links

This seems to be due to the PHP symlink () error in Windows 7 , but this error has been fixed in PHP 5.4, and I'm using 5.5. PHP also reports error code 2, not 3.

In addition to my main question (“ How to make this work? ”), I am looking for answers to the following questions:

  • ​​PHP ( Apache?)?

  • PHP CGI, ?

PHP:

  1. ?

, mod_php ( "phpt5 ts.dll" ) .

httpd.conf ( xampp):

LoadFile "G:/xampp/php/php5ts.dll"
LoadFile "G:/xampp/php/libpq.dll"
LoadModule php5_module "G:/xampp/php/php5apache2_4.dll"

<FilesMatch "\.php$">
   SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

php-cgi:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php-cgi
</FilesMatch>
<IfModule actions_module>
    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
</IfModule>
+4
1

symlink() , ( : Warning: symlink(): ( 2))

​​PHP:

is_link() false

, , . PHP Apache, CGI, is_link false . :

  • Windows 7 x64
  • XAMPP 1.8.3
  • PHP 5.5.11

PHP CGI, ?

PHP CGI , PHP , , Apache . , - . , PHP CGI , . .

PHP FastCGI , , .

, is_link ( filetype) PHP , .

0

All Articles