[PHP] Newb PHP Question

2004-08-13 Thread Andy Moore
I'm getting an error... And I have no idea how to fix it. I've never 
been able to get PHP to work.

---
Warning: Unknown(/var/www/test.php): failed to open stream: Permission 
denied in Unknown on line 0

Warning: (null)(): Failed opening '/var/www/test.php' for inclusion 
(include_path='.:/var/www') in Unknown on line 0
---

I tried combing through the PHP manual but there's no troubleshooting 
section and the FAQ doesn't address this issue. :(

- Andy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newb PHP Question

2004-08-13 Thread Andy Moore
Andy do a small page with only this in it and see if it will load.
?php
phpinfo();
?
That churned out a rather long page with all sorts of information... so 
now I'm assuming that PHP is parsing correctly, but I have some sort of 
configuration error? What that would be, I'm unsure...

-Andy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newb PHP Question

2004-08-13 Thread Andy Moore
Can we see some of the code throwing the error? PHP is working correctly
if you got the page above (a handy thing to keep around BTW).
I assumed it was a configuration error because the error occured on line 
0. But in any case, here's some lowdown.

main.php - the file everyone will be seeing, and the file that gets the 
error I originally posted...

---
?
 require(include/db.php);
 require(include/template.php);
..snip..
---
and from db.php, which may contribute to the problems...
---
?
 if(!connect()){
  echo error('Connection failed!');
 }
 session_start();
 function connect() {
  $params = array(
   'host' = localhost,
   'dbname' = nmonkey,
   'user' = [ed],
   'password' = [ed]
  );
  while(list($name,$val) = each($params)){ $constr[] = $name=$val; }
  return pg_connect(implode(' ',$constr));
 }
...snip...
---
Is maybe my include directory in php.ini set incorrectly? It's 
currently set to .:/var/www, which is where main.php resides (and 
db.php is in /var/www/include)...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Yet another Newb Question - error

2004-08-13 Thread Andy Moore
Thanks to this newsgroup I finally overcame one of my biggest errors in 
PHP. But it still doesn't work completely. :)

---
Fatal error: Call to undefined function: pg_connect() in 
/var/www/include/db.php on line 30
---

Undefined function? Isn't it a standard command?
- Andy Moore
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newb PHP Question

2004-08-13 Thread Andy Moore
httpd got access to all the files?
Ah! I fixed it now. Ok, this problem is solved, thanks all :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Yet another Newb Question - error

2004-08-13 Thread Andy Moore
Does PostGres show up in the test page we did earler? If not PHP needs
to be compiled as stated above
No, PG doesn't show up... What do you mean, compiled? Do you mean 
installed? I used

# apt-get install postrgesql
Are you saying I should say
# apt-get install postgresql --with-pgsql
? Or,
[snip]
If shared object module is available,
PostgreSQL module may be loaded using extension directive in php.ini or
dl() function.
[/snip]
How can I tell if a shared module available? That sounds like an easier 
path maybe. :) I know PostgresQL is installed, maybe I can just 
point it to a directory or something? I don't know where library files 
are stored...

- Andy Moore
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php