Re: [PHP] PHP shows nothing

2010-11-30 Thread Mohammad Taghi Khalifeh
Daniel

On Wed, Dec 1, 2010 at 1:28 AM, Daniel P. Brown
wrote:

> On Tue, Nov 30, 2010 at 16:51, Mohammad Taghi Khalifeh
>  wrote:
> > it seems that the problem is in pg_connect().
>
> Do you have PostgreSQL support compiled into PHP?
>
>Command line:
>php -i | egrep -i 'postgres|pgsql'
>
>Web:
> ?>
>

In Command line output, there was --with-pgsql=shared and
--with-pdo-pgsql=shared,
but phpinfo() did not load any library related to pgsql. so I figured out
that some libraries are not installed.
Installing php-pgsql package from fedora repos, problem solved.
Thank you so much for your help: it works for me very well. :)

Other thing that I want to know is that,
somewhereI read
that loading pdo drivers
as shared libraries are not recommended. whats wrong with that? and how can
I change that?

Mohammad


Re: [PHP] PHP shows nothing

2010-11-30 Thread Daniel P. Brown
On Tue, Nov 30, 2010 at 16:51, Mohammad Taghi Khalifeh
 wrote:
> it seems that the problem is in pg_connect().

Do you have PostgreSQL support compiled into PHP?

Command line:
php -i | egrep -i 'postgres|pgsql'

Web:


-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] PHP shows nothing

2010-11-30 Thread Mohammad Taghi Khalifeh
Marc

On Wed, Dec 1, 2010 at 1:02 AM, Marc Guay  wrote:

> >if(!$db = @pg_connect($connection_string)) {
> >return FALSE;
> >}
> >return $db;
> >
> > how can I find the problem and fix it?
>
>
> The @ symbol is telling it to ignore errors.  Remove it and you'll see
> them if that's where the problem is.
>
> http://php.net/manual/en/language.operators.errorcontrol.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Thanks for advise (I didn't know that). but removing @ did not change
anything.
it seems that the problem is in pg_connect().


Re: [PHP] PHP shows nothing

2010-11-30 Thread Marc Guay
>        if(!$db = @pg_connect($connection_string)) {
>                return FALSE;
>        }
>        return $db;
>
> how can I find the problem and fix it?


The @ symbol is telling it to ignore errors.  Remove it and you'll see
them if that's where the problem is.

http://php.net/manual/en/language.operators.errorcontrol.php

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



Re: [PHP] PHP shows nothing

2010-11-30 Thread Mohammad Taghi Khalifeh
Bob and tedd

On Tue, Nov 30, 2010 at 11:20 PM, Bob McConnell  wrote:

> From: Mohammad Taghi Khalifeh
>
> > On Tue, Nov 30, 2010 at 10:38 PM, Bob McConnell  wrote:
> >> From: Mohammad Taghi Khalifeh
> >>> Hi there,
> >>> I have a package written in pure PHP, some .php files that refer to
> >>others
> >>> via require_once(''),
> >>> but when I try to see package's contents via a browser, the pacakge
> >>just
> >>> shows nothing: a blank page.
> >>> I've activated all log levels, and it seems that php doesn't
> encounter
> >>any
> >>> problem.
> >>> I'm using PHP 5.3.3 and apache httpd 2.2.
> >>> FYI, I'm new to PHP and this mailing list :)
> >>> I would appreciate if someone could help me.
> >>
> >> One of the irregularities about require_once is that if there is a
> >> syntax error anywhere in the chain, the interpreter simply exits
> without
> >> emitting anything. If you have display errors turned off, you get
> >> nothing at all. There may be clues in the Apache error log, but don't
> >> depend on it. To debug, enable errors temporarily, or print some
> bread
> >> crumbs at the start of each file. That should at least help identify
> how
> >> far you get before it fails.
> >
> > the files are so many,  so I think tracking problem by printing some
> > bread crumbs at the start of each file is not easy,
> > something that might help is that I've turned on magic_quotes_gpc
> because
> > of the package developer's suggestion.
> > but I got this warning in both php log:
> >
> > "PHP Warning:  Directive 'magic_quotes_gpc' is deprecated in PHP 5.3
> and
> > greater in Unknown on line 0"
> > is this warning mean that 'magic_quotes_gpc' will not work properly?
> so
> > whats the alternative?
>
> No, As long as it is just a warning it still works correctly, The
> message simply points out that magic quotes was a terrible idea and they
> are finally going to remove it from the language. You should never have
> to use it.
>
> You will probably have to selectively add breadcrumbs to isolate which
> file or files are causing your problem. Even if you put them in every
> fourth file, you at least get some idea where to start digging.
>
> Bob McConnell
>

As you recommended, by adding breadcrumbs, I found the hotspot: pg_connect()
Actually, somewhere php tryes to connect to postgresql via pg_connect().
The strange thing about it is that program dies in it without any echo.
providing connection information as $connection_string, the below block ends
the program:

if(!$db = @pg_connect($connection_string)) {
return FALSE;
}
return $db;

how can I find the problem and fix it?


RE: [PHP] PHP shows nothing

2010-11-30 Thread Bob McConnell
From: Mohammad Taghi Khalifeh

> On Tue, Nov 30, 2010 at 10:38 PM, Bob McConnell  wrote:
>> From: Mohammad Taghi Khalifeh
>>> Hi there,
>>> I have a package written in pure PHP, some .php files that refer to
>>others
>>> via require_once(''),
>>> but when I try to see package's contents via a browser, the pacakge
>>just
>>> shows nothing: a blank page.
>>> I've activated all log levels, and it seems that php doesn't
encounter
>>any
>>> problem.
>>> I'm using PHP 5.3.3 and apache httpd 2.2.
>>> FYI, I'm new to PHP and this mailing list :)
>>> I would appreciate if someone could help me.
>>
>> One of the irregularities about require_once is that if there is a
>> syntax error anywhere in the chain, the interpreter simply exits
without
>> emitting anything. If you have display errors turned off, you get
>> nothing at all. There may be clues in the Apache error log, but don't
>> depend on it. To debug, enable errors temporarily, or print some
bread
>> crumbs at the start of each file. That should at least help identify
how
>> far you get before it fails.
> 
> the files are so many,  so I think tracking problem by printing some
> bread crumbs at the start of each file is not easy,
> something that might help is that I've turned on magic_quotes_gpc
because
> of the package developer's suggestion.
> but I got this warning in both php log:
> 
> "PHP Warning:  Directive 'magic_quotes_gpc' is deprecated in PHP 5.3
and
> greater in Unknown on line 0" 
> is this warning mean that 'magic_quotes_gpc' will not work properly?
so
> whats the alternative?

No, As long as it is just a warning it still works correctly, The
message simply points out that magic quotes was a terrible idea and they
are finally going to remove it from the language. You should never have
to use it.

You will probably have to selectively add breadcrumbs to isolate which
file or files are causing your problem. Even if you put them in every
fourth file, you at least get some idea where to start digging.

Bob McConnell

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



Re: [PHP] PHP shows nothing

2010-11-30 Thread Mohammad Taghi Khalifeh
On Tue, Nov 30, 2010 at 10:39 PM, Steve Staples  wrote:

> On Tue, 2010-11-30 at 22:26 +0330, Mohammad Taghi Khalifeh wrote:
> > Hi there,
> > I have a package written in pure PHP, some .php files that refer to
> others
> > via require_once(''),
> > but when I try to see package's contents via a browser, the pacakge just
> > shows nothing: a blank page.
> > I've activated all log levels, and it seems that php doesn't encounter
> any
> > problem.
> > I'm using PHP 5.3.3 and apache httpd 2.2.
> > FYI, I'm new to PHP and this mailing list :)
> > I would appreciate if someone could help me.
> >
> >
> > Best
> > Mohammad
>
>
> Pacakges, as in the classes?   if you're trying to view a class file,
> then yes, you won't (err... usually shouldn't) see anything.  If you
> were to go to the main page that actually builds the pages, utilizes the
> classes and stuff, then you should see something.
>
By saying Packages, I just meant  a bunch of files. there is no classes.


> There is also another potential issue.  There was a godaddy server that
> i used to use, i switched over a site to their servers, and all of a
> sudden, the site didn't show up.   The issue was that there were either
> trailing spaces after the ?>, or there was no closing ?> for the php
> file.
>
> Make sure that the page you're trying to pull up has some kind of echo,
> or at least output of any type... if that fails, then you can try
> adding:
> error_reporting(E_ALL);
> to the top of the page you're trying to view, to see if there are any
> errors it is generating.
>
> just some things to think/check...
>
> good luck, and Welcome to PHP!!!
>
> Steve
>
Thank you  very much for your "things" Steve, I'll check them all.

Mohammad



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


Re: [PHP] PHP shows nothing

2010-11-30 Thread tedd

At 10:26 PM +0330 11/30/10, Mohammad Taghi Khalifeh wrote:

Hi there,
I have a package written in pure PHP, some .php files that refer to others
via require_once(''),
but when I try to see package's contents via a browser, the pacakge just
shows nothing: a blank page.
I've activated all log levels, and it seems that php doesn't encounter any
problem.
I'm using PHP 5.3.3 and apache httpd 2.2.
FYI, I'm new to PHP and this mailing list :)
I would appreciate if someone could help me.


Best
Mohammad


Mohammad;

Do the included files run OK?

If there are any errors in them, you may get a blank page.

To trouble shoot this, I typically place an:

 echo('aaa');

 in the first include. That way, if I see 'aaa' at the top of the web 
page, then I know the include has loaded properly.


Cheers,

tedd

--
---
http://sperling.com/

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



Re: [PHP] PHP shows nothing

2010-11-30 Thread Mohammad Taghi Khalifeh
On Tue, Nov 30, 2010 at 10:38 PM, Bob McConnell  wrote:

> From: Mohammad Taghi Khalifeh
>
> > Hi there,
> > I have a package written in pure PHP, some .php files that refer to
> others
> > via require_once(''),
> > but when I try to see package's contents via a browser, the pacakge
> just
> > shows nothing: a blank page.
> > I've activated all log levels, and it seems that php doesn't encounter
> any
> > problem.
> > I'm using PHP 5.3.3 and apache httpd 2.2.
> > FYI, I'm new to PHP and this mailing list :)
> > I would appreciate if someone could help me.
>
> One of the irregularities about require_once is that if there is a
> syntax error anywhere in the chain, the interpreter simply exits without
> emitting anything. If you have display errors turned off, you get
> nothing at all. There may be clues in the Apache error log, but don't
> depend on it. To debug, enable errors temporarily, or print some bread
> crumbs at the start of each file. That should at least help identify how
> far you get before it fails.
>
the files are so many,  so I think tracking problem by printing some bread
crumbs at the start of each file is not easy,
something that might help is that I've turned on magic_quotes_gpc because of
the package developer's suggestion.
but I got this warning in both php log:
"PHP Warning:  Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and
greater in Unknown on line 0"
is this warning mean that 'magic_quotes_gpc' will not work properly? so
whats the alternative?

Bob McConnell
>


Re: [PHP] PHP shows nothing

2010-11-30 Thread Steve Staples
On Tue, 2010-11-30 at 22:26 +0330, Mohammad Taghi Khalifeh wrote:
> Hi there,
> I have a package written in pure PHP, some .php files that refer to others
> via require_once(''),
> but when I try to see package's contents via a browser, the pacakge just
> shows nothing: a blank page.
> I've activated all log levels, and it seems that php doesn't encounter any
> problem.
> I'm using PHP 5.3.3 and apache httpd 2.2.
> FYI, I'm new to PHP and this mailing list :)
> I would appreciate if someone could help me.
> 
> 
> Best
> Mohammad


Pacakges, as in the classes?   if you're trying to view a class file,
then yes, you won't (err... usually shouldn't) see anything.  If you
were to go to the main page that actually builds the pages, utilizes the
classes and stuff, then you should see something.

There is also another potential issue.  There was a godaddy server that
i used to use, i switched over a site to their servers, and all of a
sudden, the site didn't show up.   The issue was that there were either
trailing spaces after the ?>, or there was no closing ?> for the php
file.  

Make sure that the page you're trying to pull up has some kind of echo,
or at least output of any type... if that fails, then you can try
adding:
error_reporting(E_ALL);
to the top of the page you're trying to view, to see if there are any
errors it is generating.

just some things to think/check...

good luck, and Welcome to PHP!!!

Steve


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



RE: [PHP] PHP shows nothing

2010-11-30 Thread Bob McConnell
From: Mohammad Taghi Khalifeh

> Hi there,
> I have a package written in pure PHP, some .php files that refer to
others
> via require_once(''),
> but when I try to see package's contents via a browser, the pacakge
just
> shows nothing: a blank page.
> I've activated all log levels, and it seems that php doesn't encounter
any
> problem.
> I'm using PHP 5.3.3 and apache httpd 2.2.
> FYI, I'm new to PHP and this mailing list :)
> I would appreciate if someone could help me.

One of the irregularities about require_once is that if there is a
syntax error anywhere in the chain, the interpreter simply exits without
emitting anything. If you have display errors turned off, you get
nothing at all. There may be clues in the Apache error log, but don't
depend on it. To debug, enable errors temporarily, or print some bread
crumbs at the start of each file. That should at least help identify how
far you get before it fails.

Bob McConnell

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



[PHP] PHP shows nothing

2010-11-30 Thread Mohammad Taghi Khalifeh
Hi there,
I have a package written in pure PHP, some .php files that refer to others
via require_once(''),
but when I try to see package's contents via a browser, the pacakge just
shows nothing: a blank page.
I've activated all log levels, and it seems that php doesn't encounter any
problem.
I'm using PHP 5.3.3 and apache httpd 2.2.
FYI, I'm new to PHP and this mailing list :)
I would appreciate if someone could help me.


Best
Mohammad