PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, January 12, 2022

[FIXED] Moving windows server to lamp PHP file stream errors

 January 12, 2022     lamp, php     No comments   

Issue

I figured this would be an issue eventually and I'm a complete linux noob. My folder structure is like so:

var
+www
++AutoVerify3
+++ajax
+++php
+++results
++++index.php <--The file generating the error
+++users
++++jerred
+++++uploads
++++++combined.xml <--The file I'm trying to open

So from the index.php file above, I'm trying to open the combined.xml and I keep getting this error:

Warning: file_get_contents(AutoVerify3/users/jerred/uploads/Combined.xml): failed to open stream: No such file or directory in /var/www/AutoVerify3/results/index.php

Here is the php code:

$xmlFile = substr($_SERVER['PHP_SELF'],1,strpos($_SERVER['PHP_SELF'],"/",1)).'users'.DIRECTORY_SEPARATOR.''.$_SESSION['myusername'].DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.$_POST['batchFile'];
$xml = file_get_contents($xmlFile);

I've tried several different path combinations but my linux knowledge is lacking.


Solution

At risk of being too obvious, the file is combined.xml (lowercase) but you're including Combined.xml (capitalised). Sanity check it, and confirm please? :)



Answered By - Joe
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing