path - File not found with subdomain and php's system() function -
path - File not found with subdomain and php's system() function -
in php script want check file types, this:
$info = explode('/',system("file -bi -- uploads/img/test.gif"));
if ( $info[0]) echo 'ok';
this working fine, long url without subdomain, f.e domain.com, not working under en.domain.com. appears, file not found.
on other hand, if in same script check existance of file:
if ( file_exists("uploads/img/test.gif")) echo 'exists';
the file found, wheter current url domain.com or en.domain.com. why file not found, if system() function used?
solvedfriends, figured out solution, after 3 working days. maybe can imagine how relieved am.
the solution in php options activate mod_rewrite. allready activated in regular domain, not subdomains. guess have thought of earlier. though answers didnt lead me how solve this, still give thanks input, going in same directions trying solve myself past days.
the shell command not take file root same php command (one user's root directory , other webserver think), utilize absolute path(s) in shell command , work how want it.
you work out 2 url's file command using pwd, e.g.
echo system('pwd');
or utilize finfo-open instead of shell command should avoid problem.
php path subdomain
Comments
Post a Comment