Jump to content

My old code now wont work on FAST CGI box


evil turnip

Recommended Posts

HI im revisiting php after along time away .. did have it as a ISAPI server but under another thread advised to install as FAST cgi etc...so have done ...

 

So would it change my code or how it works ...not done this in years but here is the code snippet test im trying to get working

 

 

<?php

$file = '\\\\testme\tmp\intake.htm';

$newfile = '\\\\test\test2.php.bak';

 

if (!copy($file, $newfile))

{

echo "failed to copy $file...\n";

}

?>

<?php include '\\\testme\tmp\intake.htm';?>

 

PHP Warning: copy(\\testme\tmp\intake.htm) [function.copy]: failed to open stream: Invalid argument in C:\Inetpub\wwwroot\test.php on line 9 PHP

 

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.

allow_url_fopen = On

 

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.

allow_url_include = on

 

This code worked fine when on the old ISAPI box any pointers or tips ... ? Thanks

Those are not URL's, so the settings you mentioned have nothing to do with an error about an Invalid argument. Those are not a valid file system paths either.

 

You either need to use / (on Windows, php converts / to \) or you need to use \\ for each \ to escape the \. Where did you came up with \\\\ for a local file path?

<?php include '\\\\testme\\tmp\\intake.htm';?>

 

produces

 

PHP Warning: include(\\testme\tmp\intake.htm) [function.include]: failed to open stream: Invalid argument in C:\Inetpub\wwwroot\index5.php on line 317 PHP Warning: include() [function.include]: Failed opening '\\testme\tmp\intake.htm' for inclusion (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\index5.php on line 317

 

 

Notice \\\\ = \\ when it resolves which is correct for windows browsing

 

Change it to \\ you get one \ see my confusion ... like i said im revisiting php after a long time away

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.