Portál AbcLinuxu, 10. května 2025 04:42
Ahoj, mam na mem serveru problem s PEAREM, distribuce je SUSE, PHP mam kompilovano s temito parametry:
./configure' '--prefix=/usr' '--datadir=/usr/share/php' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' '--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--disable-ctype' '--with-mysql' '--disable-cli' '--with-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' '--with-curl' '--enable-cli' '--enable-session' '--with-config-file-path=/etc/apache2'
A script neustale vypisuje tuto chybu:
try to connect DB fail!!!DB Error: not founddb_error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => -4 [message] => DB Error: not found [userinfo] => Unable to include the DB/mysql.php file for 'mysql://adm:qwerty@localhost/prologis' [backtrace] => Array ( [0] => Array ( [file] => /var/www/httpdocs/DB.php [line] => 888 [function] => pear_error [class] => db_error [type] => -> [args] => Array ( [0] => DB Error: not found [1] => -4 [2] => 1 [3] => 1024 [4] => Unable to include the DB/mysql.php file for 'mysql://adm:qwerty@localhost/prologis' ) ) [1] => Array ( [file] => /var/www/httpdocs/PEAR.php [line] => 563 [function] => db_error [class] => db_error [type] => -> [args] => Array ( [0] => -4 [1] => 1 [2] => 1024 [3] => Unable to include the DB/mysql.php file for 'mysql://adm:qwerty@localhost/prologis' ) ) [2] => Array ( [file] => /var/www/httpdocs/DB.php [line] => 543 [function] => raiseerror [class] => pear [type] => :: [args] => Array ( [0] => [1] => -4 [2] => [3] => [4] => Unable to include the DB/mysql.php file for 'mysql://adm:qwerty@localhost/prologis' [5] => DB_Error [6] => 1 ) ) [3] => Array ( [file] => /var/www/httpdocs/connect.php [line] => 17 [function] => connect [class] => db [type] => :: [args] => Array ( [0] => mysql://adm:qwerty@localhost/prologis ) ) [4] => Array ( [file] => /var/www/httpdocs/index.php [line] => 2 [args] => Array ( [0] => /var/www/httpdocs/connect.php ) [function] => require_once ) ) [callback] => )
Fatal error: Call to a member function on a non-object in /var/www/httpdocs/lib/User.php on line 97
Prestoze heslo, uzivatel i jmeno databaze jsou spravne. Muzete nekdo pomoci? Dekuji
...Unable to include the DB/mysql.php file...
? PEARu prostě chybí knihovna pro práci s MySQL. Máš ji tam? Includuješ ji (příp. je správně nastavený include_path
)?
require_once('./lib/pear/PEAR.php'); require_once('./lib/pear/DB.php'); require_once('./lib/pear/DB/mysql.php');Cesty můžou být samozřejmě jiné (to na konci by mělo být stejné), důležité je, aby se daly z toho adresáře includovat a aby se tak taky dělo.
ini_set('include_path',ini_get('include_path').':./lib/kde_je_adresar_knihoven');
/usr/share/php/
, takže pokud z nějakého důvodu není v include_path
, tak je nutné tam tuto cestu přidat.
Warning: main(): open_basedir restriction in effect. File(/usr/share/php/DB.php) is not within the allowed path(s): (/var/www/httpdocs:/tmp) in /var/www/httpdocs/connect.php on line 5 Warning: main(DB.php): failed to open stream: Operation not permitted in /var/www/httpdocs/connect.php on line 5 Fatal error: main(): Failed opening required 'DB.php' (include_path='.:/usr/share/php') in /var/www/vhosts/connect.php on line 5v php.ini mam include_path='.:/usr/share/php'
Warning: main(): open_basedir restriction in effect. File(/usr/share/php/DB.php) is not within the allowed path(s): (/var/www/httpdocs:/tmp) in /var/www/httpdocs/connect.php on line 5 Warning: main(DB.php): failed to open stream: Operation not permitted in /var/www/httpdocs/connect.php on line 5 Fatal error: main(): Failed opening required 'DB.php' (include_path='.:/usr/share/php') in /var/www/vhosts/connect.php on line 5v php.ini mam include_path='.:/usr/share/php'
safe_mode_include_dir
cestu k adresari /usr/share/php
a mohlo by byt po problemech.
safe_mode_include_dir = ".:/usr/share/php/"
safe_mode_include_dir = ".:/usr/share/php/"
safe_mode_include_dir = "/usr/share/php"
, myslim ze s tim lomitkem mi to vcera nefungovalo. Ale prvni co bych udelal je to, ze bych napred vypnul Safe mod, otestoval to na vypnutem safe mode a nasledne resil problem se zapnutym safe mode.
Warning: main(): SAFE MODE Restriction in effect. The script whose uid is 10001 is not allowed to access /usr/share/php/DB.php owned by uid 0 in /var/www/vhosts/prologistics.info/httpdocs/connect.php on line 5 Warning: main(DB.php): failed to open stream: No such file or directory in /var/www/vhosts/prologistics.info/httpdocs/connect.php on line 5 Fatal error: main(): Failed opening required 'DB.php' (include_path='.:/usr/share/php') in /var/www/vhosts/prologistics.info/httpdocs/connect.php on line 5Je to divny, protoze safe mode mam v php.ini vypnuty
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.