Zoranos Posted March 27, 2012 Share Posted March 27, 2012 Hi, i have problem with libraries, with fpdf and PHPEcel, problem is same... Can't open file C:\xampp\htdocs\skripta\.... - this is path to php script on my computer everything work ok on localhost when i test, but when i upload to web server, pdf script try to create file with old windows path: Can't open file C:\xampp\htdocs\skripta\, and not with linux path... does anyone have solution, and why is that? Quote Link to comment https://forums.phpfreaks.com/topic/259781-php-file-path-on-webserver-same-as-my-computer/ Share on other sites More sharing options...
trq Posted March 27, 2012 Share Posted March 27, 2012 does anyone have solution, Use $_SERVER['DOCUMENT_ROOT'] as the base of your includes. and why is that? Because server can be configured to serve from different locations on the filesystem. Quote Link to comment https://forums.phpfreaks.com/topic/259781-php-file-path-on-webserver-same-as-my-computer/#findComment-1331432 Share on other sites More sharing options...
Zoranos Posted March 27, 2012 Author Share Posted March 27, 2012 does anyone have solution, Use $_SERVER['DOCUMENT_ROOT'] as the base of your includes. and why is that? Because server can be configured to serve from different locations on the filesystem. but i didnt use anywhere path... only that library open font file, and cant open becasue its thry to reach old path from my computer... i dont know how to solve this... Quote Link to comment https://forums.phpfreaks.com/topic/259781-php-file-path-on-webserver-same-as-my-computer/#findComment-1331439 Share on other sites More sharing options...
scootstah Posted March 27, 2012 Share Posted March 27, 2012 Post relevant code please. Quote Link to comment https://forums.phpfreaks.com/topic/259781-php-file-path-on-webserver-same-as-my-computer/#findComment-1331452 Share on other sites More sharing options...
Zoranos Posted March 27, 2012 Author Share Posted March 27, 2012 Post relevant code please. i solved this, downloaded again same files for libraryes and now working fine... i dont know why old files used xampp paths... Quote Link to comment https://forums.phpfreaks.com/topic/259781-php-file-path-on-webserver-same-as-my-computer/#findComment-1331463 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.