ray Posted November 6, 2006 Report Share Posted November 6, 2006 (edited) Pēc formas nosūtīšanas ar insert datubāzē pievienojas informācija no formas, bet tad es nonāku pie problēmas, ka man ir jāuztaisa katru reizi, pēc šīs pievienošanas formas, jaunas mapes ar apakšdirektorijām, bet lieta tāda, ka safe_mone = on (hostējos) un man netaisās apakšdirektorijas. Jau forumā atradu vairākas vietas ar šo problēmu, bet jēdzīgu risinājumu neatradu, arī google un php.net skatījos, bet nu pats nekādi netieku galā, tāpēc varbūt kāds var palīdzēt. Zinu, ka problēma ir ar failu permissions. kods: mkdir("../../img/users/$mainigais"); mkdir("../../img/users/$mainigais/bildes"); mkdir("../../img/users/$mainigais/faili"); mkdir("../../img/users/$mainigais/bildes/lielaas"); mkdir("../../img/users/$mainigais/bildes/mazaas"); Edited November 6, 2006 by ray Link to comment Share on other sites More sharing options...
Delfins Posted November 6, 2006 Report Share Posted November 6, 2006 (edited) Nu manuālī ir skaidri un gaiši pateikts.. When safe mode is enabled, PHP checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed. Kā vienīgais risinājums ir piespiest adminu sakonfigurēt pareizi serveri. PS: Vai `/img/users` ir taisīts no FTP vai ar PHP? Paskatis viņam owneri PPS: ja tev ir FTP accounts, tad paskaties arī šo risinājumu http://lv.php.net/manual/en/function.mkdir.php#69267 Tā ir, ka nelasa dokumentāciju... Edited November 6, 2006 by Delfins Link to comment Share on other sites More sharing options...
andrisp Posted November 6, 2006 Report Share Posted November 6, 2006 Tāpat arī man šķiet safe modē nevarēja "kāpt pa direktorijām" augšup, tas ir, izmantot "../". Bet varbūt maldos, bet ir vērts pārbaudīt. Link to comment Share on other sites More sharing options...
ray Posted November 6, 2006 Author Report Share Posted November 6, 2006 uz sava pc man viss izdodas, bet uz hostinga nē :/ /img/users ir taisīts ar ftp permissions 777. paskatīšos un ievērtēšu delfīna ieteikumu ar ftp connection. Link to comment Share on other sites More sharing options...
Delfins Posted November 6, 2006 Report Share Posted November 6, 2006 (edited) /img/users ir taisīts ar ftp permissions 777.Tu LASĪT māki?has the same UID Edited November 6, 2006 by Delfins Link to comment Share on other sites More sharing options...
ray Posted November 6, 2006 Author Report Share Posted November 6, 2006 owner ir "apache" Link to comment Share on other sites More sharing options...
andrisp Posted November 6, 2006 Report Share Posted November 6, 2006 http://lv.php.net/features.safe-mode Pārbaudi open_basedir. Paskaties phpinfo(); Vai open_basedir gadienā nav "." ? Link to comment Share on other sites More sharing options...
ray Posted November 6, 2006 Author Report Share Posted November 6, 2006 (edited) Paskaties phpinfo(); Vai open_basedir gadienā nav "." ? open_basedir "no value" Edited November 6, 2006 by ray Link to comment Share on other sites More sharing options...
andrisp Posted November 6, 2006 Report Share Posted November 6, 2006 owner ir "apache" A varbūt pats apache nemaz nestrādā kā apache lietotājs ? Link to comment Share on other sites More sharing options...
ray Posted November 6, 2006 Author Report Share Posted November 6, 2006 (edited) http://lv.php.net/manual/en/function.mkdir.php#69267 Warning: ftp_login() [function.ftp-login]: Login incorrect. in D:\bla_bla\test.php on line 11 rakstu visu to pašu ko ftp klientā, tāpēc šaubos vai login info varētu būt nepareiza Edited November 6, 2006 by ray Link to comment Share on other sites More sharing options...
Delfins Posted November 6, 2006 Report Share Posted November 6, 2006 (edited) Nu logins IR nepareizs... ko tu vēl gribi dzirdēt? paskaties, ar kādu jūzeri tiek laists PHP un salīdzini ar direktorijas UID (apache) print (getmyuid() == fileowner('/img/users')); Edited November 6, 2006 by Delfins Link to comment Share on other sites More sharing options...
ray Posted November 6, 2006 Author Report Share Posted November 6, 2006 paskaties, ar kādu jūzeri tiek laists PHP un salīdzini ar direktorijas UID (apache) kā var paskatīties ar kādu jūzeri tiek laists php, sorry par jaut. Link to comment Share on other sites More sharing options...
Delfins Posted November 6, 2006 Report Share Posted November 6, 2006 iemācies lasīt Link to comment Share on other sites More sharing options...
blackhalt Posted November 6, 2006 Report Share Posted November 6, 2006 uztaisi to /img direktoriju ar PHP Link to comment Share on other sites More sharing options...
ray Posted November 6, 2006 Author Report Share Posted November 6, 2006 paskaties, ar kādu jūzeri tiek laists PHP un salīdzini ar direktorijas UID (apache) print (getmyuid() == fileowner('/img/users')); izmet 1 bet ar php uztaisītajai direktorijai neko neparāda Link to comment Share on other sites More sharing options...
Recommended Posts