• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 571
  • Last Modified:

changing forward slash to backslash in PHP IIS

Hi folks,

I'm having a minor issue with an app I'm installing (a mod for Magento's ecommerce platform to be precise) and I know on Windows PHP can use either / or \ in directory structure, but I'm getting an error running my app that looks like this:


error loading: "C:\Inetpub\wwwroot\subdomains\tools\magento\var\import/test_import.csv".

you can see the / right before test_import.csv being the problem (it needs to be a \ too) - what I'm wondering is, would that be a PHP config issue, an IIS config issue, or does that look like it might be something in the app code I'm trying to run?

Thanks!

0
merv109
Asked:
merv109
2 Solutions
 
Jagadishwor DulalBraces MediaCommented:
IF you want to use \ then try using \\ for every \ or you can use all / Like:
C:/Inetpub/wwwroot/subdomains/tools/magento/var/import/test_import.csv

or

C:\\Inetpub\\wwwroot\\subdomains\\tools\\magento\\var\\import\\test_import.csv
0
 
dmgroomCommented:
my guess would be an error in the code
0
 
Ray PaseurCommented:
PHP has a predefined constant that is environmentally aware.  Instead of using a slash in the code, use DIRECTORY_SEPARATOR instead.
0
 
miked2004Commented:
The constants that are used in magento are: "PS" and "DS".
0
 
merv109Author Commented:
Thanks
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now