LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-29-2009, 06:47 AM   #1
toredo
Member
 
Registered: Feb 2009
Posts: 83

Rep: Reputation: 25
sqlite with php5 on debian


hello,

i installed boa and php5 on an small arm board with debian lenny. php works great.

so i installed sqlite3:
Code:
apt-get install sqlite3 php5-sqlite
now, both is installed, but if i try to execute my php-script which opens a sqlite3-database there is an error:
Quote:
Fatal error: Uncaught exception 'PDOException' with message 'safe_mode/open_basedir prohibits opening ' in /var/www/cgi-bin/Database.php:7 Stack trace: #0 /var/www/cgi-bin/Database.php(7): PDO->__construct('sqlite:') #1 /var/www/cgi-bin/Get.php(30): GetDb() #2 {main} thrown in /var/www/cgi-bin/Database.php on line 7
database.php is used in Get.php with "include 'Database.php'";

and there's a function, which opens the database:
Code:
return new PDO("sqlite:/var/www/cgi-bin/Database.sqlite3");
i changed the path much times, but it never worked.

i opened the php.ini and searched for "safe_mode" and "open_basedir".
safe_mode is disabled and open_basedir is not defined (so i'ts disabled too).

do you know why it doesnt work?

best regards
toredo
 
Old 11-17-2009, 09:33 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
I would listen to the error message. openbase_dir prevents the file from beeing open. Debian uses two config files one in /etc/php/apache and one in /etc/php/cli. Also you don't have php5-module for apache installed. Hm to be extra sure see which php.ini gets loaded by the script.

Code:
php -r "phpinfo()" | grep "php.ini"
should do the trick.
If none is loaded use the -c option to php and pass the path to the config file.
If this all does not work try to create a new php.ini with only basedir and safe_mode options inside (and turned of of cause )

Hope that helps
Zhjim

P.S.
Is the file writable for the user? chown user:user /path/to/db
 
Old 12-30-2009, 02:36 AM   #3
omegas
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
Problem with php5 on arm board

Quote:
Originally Posted by toredo View Post
hello,

i installed boa and php5 on an small arm board with debian lenny. php works great.

so i installed sqlite3:
Code:
apt-get install sqlite3 php5-sqlite
now, both is installed, but if i try to execute my php-script which opens a sqlite3-database there is an error:


database.php is used in Get.php with "include 'Database.php'";

and there's a function, which opens the database:
Code:
return new PDO("sqlite:/var/www/cgi-bin/Database.sqlite3");
i changed the path much times, but it never worked.

i opened the php.ini and searched for "safe_mode" and "open_basedir".
safe_mode is disabled and open_basedir is not defined (so i'ts disabled too).

do you know why it doesnt work?

best regards
toredo
I am facing nearly the same problem with you since I want to cross compile php5 with sqlite3 on the arm board installed with boa web server but it did not work. As I read your meesage, it seemed that you were successfully installed php5 on arm board and make it work without problem. Is it possible that you can send a file to me step and step to show how to cross compile php5 and install what files to make php5 works on the arm board. I have been trouble by this for a long time and as you know it is a very painful process. Thousand thanks.

php version: 5.3.0
sqlite version: 3.6.19
web server: boa

Kan

Last edited by omegas; 12-30-2009 at 02:39 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
debian php5 - command not found getmizanur Linux - Newbie 5 09-20-2009 01:36 AM
[Debian - Etch] GDLib with php5 not working? Zac_tw Debian 0 05-28-2008 01:36 AM
Compile PHP5 on Debian, APXS prob..!! ALInux Linux - Software 1 08-24-2007 04:51 AM
php5 not working with apache2 in debian 4.0 mohtasham1983 Linux - Server 2 08-08-2007 09:19 PM
Debian Etch and php5 problem paddyjoy Linux - Newbie 4 12-02-2006 05:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration