php-general Digest 26 Feb 2006 08:00:32 -0000 Issue 3985

Topics (messages 231062 through 231095):

Re: RSS / XML
        231062 by: Weber Sites LTD
        231063 by: Gustav Wiberg

PHP upgrade on Go Daddy virtual server
        231064 by: Nicolas Verhaeghe

Error compiling php 5.1.2
        231065 by: Paul Reinheimer
        231081 by: chris smith
        231086 by: Paul Reinheimer
        231091 by: Richard Lynch
        231094 by: Paul Reinheimer

Expat + PHP Examples...
        231066 by: Gustav Wiberg

defined
        231067 by: sub.drewpydraws.com
        231077 by: Philip Hallstrom
        231078 by: chris smith
        231079 by: sub.drewpydraws.com
        231087 by: tedd
        231089 by: Richard Lynch

not sure, what now
        231068 by: Schalk
        231072 by: Rory Browne
        231076 by: chris smith
        231082 by: Schalk
        231084 by: chris smith
        231088 by: Richard Lynch
        231092 by: Michael Hulse
        231093 by: Michael Hulse

Linux distributions and tools for Linux/Apache/PHP/MySQL dev
        231069 by: Chris Lott
        231073 by: chris smith
        231090 by: Austin (Ozz) Denyer
        231095 by: Curt Zirzow

Re: How do I read Exif data without a file?
        231070 by: chris smith
        231071 by: Niels
        231074 by: chris smith
        231075 by: Niels

Re: How can I make postgre execute file with SQL code, on windows platform
        231080 by: chris smith

HTML_QuickForm
        231083 by: Atif Khan
        231085 by: chris smith

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Here are a few (from easy to hard)

Parsing XML With DOMXML And PHP
http://www.weberdev.com/ViewArticle-158.html

Converting XML Into a PHP Data Structure
http://www.weberdev.com/ViewArticle-389.html

Building XML Trees with PEAR's XML_Tree Class
http://www.weberdev.com/ViewArticle-345.html

Building XML Web Services with PHP NuSOAP
http://www.weberdev.com/ViewArticle-336.html

Serializing XML With PHP
http://www.weberdev.com/ViewArticle/450 

Injecting XML Content Into Page Templates With patXMLRenderer 
http://www.weberdev.com/ViewArticle/441

berber
-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 25, 2006 2:55 PM
To: PHP General
Subject: [PHP] RSS / XML

Hi there guys!

Where is a good startpoint for learning XML Reader on a very, very basic
level? (I appreciate links) Is RSS a technique for retrieving XML? I can't
clue the pieces together...

/G

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

--- End Message ---
--- Begin Message --- ----- Original Message ----- From: "Weber Sites LTD" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "'PHP General'" <php-general@lists.php.net>
Sent: Saturday, February 25, 2006 7:37 PM
Subject: RE: [PHP] RSS / XML


Here are a few (from easy to hard)

Parsing XML With DOMXML And PHP
http://www.weberdev.com/ViewArticle-158.html

Converting XML Into a PHP Data Structure
http://www.weberdev.com/ViewArticle-389.html

Building XML Trees with PEAR's XML_Tree Class
http://www.weberdev.com/ViewArticle-345.html

Building XML Web Services with PHP NuSOAP
http://www.weberdev.com/ViewArticle-336.html

Serializing XML With PHP
http://www.weberdev.com/ViewArticle/450

Injecting XML Content Into Page Templates With patXMLRenderer
http://www.weberdev.com/ViewArticle/441

berber
-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 25, 2006 2:55 PM
To: PHP General
Subject: [PHP] RSS / XML

Hi there guys!

Where is a good startpoint for learning XML Reader on a very, very basic
level? (I appreciate links) Is RSS a technique for retrieving XML? I can't
clue the pieces together...

/G

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

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

Thanx!

/G
--- End Message ---
--- Begin Message ---
Has anybody heard (or done it himself) how to upgrade PHP on a Go Daddy
virtual server?

Current version is 4.3.11 and I'd like to upgrade to 5.1.2.

All I know is that this server is a Red Hat Fedora 2.

I have SSH access and root as well.

Thanks for your help!

--- End Message ---
--- Begin Message ---
Hi, I'm trying to compile PHP 5.1.2.
My ./configure is:

'./configure' '--with-mysql=/usr/local/mysql'
'--with-apxs=/etc/httpd/bin/apxs' '--with-gd' '--with-png'
'--with-zlib-dir=/root/zlib-1.2.2' '--enable-gd-native-ttf'
'--with-ttf' '--with-jpeg-dir=/usr/local/lib/jpeg-6b/'
'--with-freetype-dir=/usr/local/lib/freetype-2.1.9/'
'--with-xpm-dir=/usr/X11R6/' '--with-tidy' '--with-curl'
'--with-openssl=/usr/local/' '--enable-dba=shared' '--with-db4'
'--disable-eapi' '--with-xsl' '--enable-memory-limit'
'--with-libxml-dir=/usr/local/lib/'

make ends with

collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


anyone got any ideas, or hints on what information I should be giving
to make diagnosis easier/possible?



thanks
paul


--
Paul Reinheimer

--- End Message ---
--- Begin Message ---
On 2/26/06, Paul Reinheimer <[EMAIL PROTECTED]> wrote:
> Hi, I'm trying to compile PHP 5.1.2.
> My ./configure is:
>
> './configure' '--with-mysql=/usr/local/mysql'
> '--with-apxs=/etc/httpd/bin/apxs' '--with-gd' '--with-png'
> '--with-zlib-dir=/root/zlib-1.2.2' '--enable-gd-native-ttf'
> '--with-ttf' '--with-jpeg-dir=/usr/local/lib/jpeg-6b/'
> '--with-freetype-dir=/usr/local/lib/freetype-2.1.9/'
> '--with-xpm-dir=/usr/X11R6/' '--with-tidy' '--with-curl'
> '--with-openssl=/usr/local/' '--enable-dba=shared' '--with-db4'
> '--disable-eapi' '--with-xsl' '--enable-memory-limit'
> '--with-libxml-dir=/usr/local/lib/'
>
> make ends with
>
> collect2: ld returned 1 exit status
> make: *** [sapi/cli/php] Error 1
>
>
> anyone got any ideas, or hints on what information I should be giving
> to make diagnosis easier/possible?

Might be better to ask on the devel list, the developers will be able
to help you out better with this problem.

--- End Message ---
--- Begin Message ---
Thanks,

I've subscribed to and posted to the instalation list. I'm going to
try and stay off internals@ if I have a choice.


thanks
paul

--- End Message ---
--- Begin Message ---
On Sat, February 25, 2006 4:08 pm, Paul Reinheimer wrote:
> './configure' '--with-mysql=/usr/local/mysql'
> '--with-apxs=/etc/httpd/bin/apxs' '--with-gd' '--with-png'
> '--with-zlib-dir=/root/zlib-1.2.2' '--enable-gd-native-ttf'
> '--with-ttf' '--with-jpeg-dir=/usr/local/lib/jpeg-6b/'
> '--with-freetype-dir=/usr/local/lib/freetype-2.1.9/'
> '--with-xpm-dir=/usr/X11R6/' '--with-tidy' '--with-curl'
> '--with-openssl=/usr/local/' '--enable-dba=shared' '--with-db4'
> '--disable-eapi' '--with-xsl' '--enable-memory-limit'
> '--with-libxml-dir=/usr/local/lib/'
>
> make ends with
>
> collect2: ld returned 1 exit status
> make: *** [sapi/cli/php] Error 1
>
> anyone got any ideas, or hints on what information I should be giving
> to make diagnosis easier/possible?

I was watching a movie last night.

I saw this when if was over:  "The End"

What was the movie about?

:-)

What happened BEFORE ld told you thins were broken?

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
I posted the full output of make earlier in this thread, as well as the
configure command i'm using, what are you looking for? The ./configure
output lines that reference libxml say nothing out of the ordinary.




paul


On 2/25/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Sat, February 25, 2006 4:08 pm, Paul Reinheimer wrote:
> > './configure' '--with-mysql=/usr/local/mysql'
> > '--with-apxs=/etc/httpd/bin/apxs' '--with-gd' '--with-png'
> > '--with-zlib-dir=/root/zlib-1.2.2' '--enable-gd-native-ttf'
> > '--with-ttf' '--with-jpeg-dir=/usr/local/lib/jpeg-6b/'
> > '--with-freetype-dir=/usr/local/lib/freetype-2.1.9/'
> > '--with-xpm-dir=/usr/X11R6/' '--with-tidy' '--with-curl'
> > '--with-openssl=/usr/local/' '--enable-dba=shared' '--with-db4'
> > '--disable-eapi' '--with-xsl' '--enable-memory-limit'
> > '--with-libxml-dir=/usr/local/lib/'
> >
> > make ends with
> >
> > collect2: ld returned 1 exit status
> > make: *** [sapi/cli/php] Error 1
> >
> > anyone got any ideas, or hints on what information I should be giving
> > to make diagnosis easier/possible?
>
> I was watching a movie last night.
>
> I saw this when if was over:  "The End"
>
> What was the movie about?
>
> :-)
>
> What happened BEFORE ld told you thins were broken?
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
>


--
Paul Reinheimer
Zend Certified Engineer

--- End Message ---
--- Begin Message ---
Hi there!

I've found out that I can use expat XML, but I can't figure out HOW to use... it seems simple, but I tried and can't figure it out...

I'd like to get retrieve info from
http://www.frisim.com/frisim/servlet/rss?searchString=google

and convert it to html...

I've read a lot a of text for Expat, but found no really good example (I found one at phpbuilder.com but with links that went to xml-files that didn't exists ):

Someone who have used expat.. ..and can give me a hint...

/G
--- End Message ---
--- Begin Message ---
I'm having kind of a weird problem I want $MailSubject to contain a the value 
"prayer" unless I tell it other wise. 

// on a form processor. 
$MailSubject = "Praise";
include_once("mailit.php");

// then in mailit.php
include "form2mail.php";

// and in formtomail.php
if(!defined($MailSubject)) // This is the problem line
{
   $MailSubject = "Prayer"; 
}

The problem I believe is with the defined function check. (I think) the value 
of $MailSubject is maintained to the end so I'm don't think it to be a scope 
issue, but also, if I don't assign a value to it it should be running the if() 
statement, but it's not. 

Any thoughts?


~Drew
www.drewpydraws.com

--- End Message ---
--- Begin Message ---

I'm having kind of a weird problem I want $MailSubject to contain a the value 
"prayer" unless I tell it other wise.

// on a form processor.
$MailSubject = "Praise";
include_once("mailit.php");

// then in mailit.php
include "form2mail.php";

// and in formtomail.php
if(!defined($MailSubject)) // This is the problem line
{
  $MailSubject = "Prayer";
}

The problem I believe is with the defined function check. (I think) the value of $MailSubject is maintained to the end so I'm don't think it to be a scope issue, but also, if I don't assign a value to it it should be running the if() statement, but it's not.

Any thoughts?

Try...  if (empty($MailSubject)

-philip

--- End Message ---
--- Begin Message ---
On 2/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm having kind of a weird problem I want $MailSubject to contain a the value 
> "prayer" unless I tell it other wise.
>
> // on a form processor.
> $MailSubject = "Praise";
> include_once("mailit.php");
>
> // then in mailit.php
> include "form2mail.php";
>
> // and in formtomail.php
> if(!defined($MailSubject)) // This is the problem line
> {
>    $MailSubject = "Prayer";
> }

As Philip said, try if (empty($MailSubject))

defined only checks constants:

<?php
define('my_var', 'test');
if (defined('my_var')) {
  echo 'found it!<br/>';
} else {
  echo 'not found!<br/>';
}
?>

--- End Message ---
--- Begin Message ---
Well ain't that a kick in the pants? Works great now, thanks. And now I see
the difference between empty() and defined().

Again, many thanks,

~Drew
www.drewpydraws.com

----- Original Message ----- 
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <php-general@lists.php.net>
Sent: Saturday, February 25, 2006 3:27 PM
Subject: Re: [PHP] defined


>
> > I'm having kind of a weird problem I want $MailSubject to contain a the
value "prayer" unless I tell it other wise.
> >
> > // on a form processor.
> > $MailSubject = "Praise";
> > include_once("mailit.php");
> >
> > // then in mailit.php
> > include "form2mail.php";
> >
> > // and in formtomail.php
> > if(!defined($MailSubject)) // This is the problem line
> > {
> >   $MailSubject = "Prayer";
> > }
> >
> > The problem I believe is with the defined function check. (I think) the
> > value of $MailSubject is maintained to the end so I'm don't think it to
> > be a scope issue, but also, if I don't assign a value to it it should be
> > running the if() statement, but it's not.
> >
> > Any thoughts?
>
> Try...  if (empty($MailSubject)
>
> -philip
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 268.1.0/269 - Release Date: 2/24/2006
>
>

--- End Message ---
--- Begin Message ---
I'm having kind of a weird problem I want $MailSubject to contain a the value "prayer" unless I tell it other wise.

// on a form processor.
$MailSubject = "Praise";
include_once("mailit.php");

// then in mailit.php
include "form2mail.php";

// and in formtomail.php
if(!defined($MailSubject)) // This is the problem line
{
   $MailSubject = "Prayer";
}

The problem I believe is with the defined function check. (I think) the value of $MailSubject is maintained to the end so I'm don't think it to be a scope issue, but also, if I don't assign a value to it it should be running the if() statement, but it's not.

Any thoughts?


~Drew
www.drewpydraws.com

Drew:

This will work:

     if(!isset($MailSubject))
        {
         $MailSubject = "Prayer";
        }

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

--- End Message ---
--- Begin Message ---
On Sat, February 25, 2006 4:18 pm, [EMAIL PROTECTED] wrote:
> I'm having kind of a weird problem I want $MailSubject to contain a
> the value "prayer" unless I tell it other wise.
>
> // on a form processor.
> $MailSubject = "Praise";
> include_once("mailit.php");
>
> // then in mailit.php
> include "form2mail.php";
>
> // and in formtomail.php
> if(!defined($MailSubject)) // This is the problem line

defined checks for CONSTANTS, not variables.

You may want http://php.net/isset
Or maybe you want if ($MailSubject == "")

But for sure you don't want defined.

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
Greetings All,

I am pretty new to PHP and are tasked to move a clients site from:

www.domain.com/somedirectory/home.php to www.home.php

Sounds simple at first but, when I moved the files to the root of the httpdocs I get an array of errors in the vain of: *Warning*: main(): open_basedir restriction in effect. File(../inc/siteconfig.php) is not within the allowed path(s): (/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs:/tmp) in /home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on line 1

What exactly does this mean? I am sure there must be a config somewhere that has set it up to load from the sub directory and now it prevents it from loading from the root directory. Is this correct? What exactly does this error mean? Thanks to all!*
*

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

--- End Message ---
--- Begin Message ---
On 2/25/06, Schalk <[EMAIL PROTECTED]> wrote:
>
> Greetings All,
>
> I am pretty new to PHP and are tasked to move a clients site from:
>
> www.domain.com/somedirectory/home.php to www.home.php

Is there a .php tld?



Sounds simple at first but, when I moved the files to the root of the
> httpdocs I get an array of errors in the vain of:
> *Warning*: main(): open_basedir restriction in effect.
> File(../inc/siteconfig.php) is not within the allowed path(s):
> (/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs:/tmp) in
> /home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on line 1
>
> What exactly does this mean? I am sure there must be a config somewhere
> that has set it up to load from the sub directory and now it prevents it
> from loading from the root directory. Is this correct? What exactly does
> this error mean? Thanks to all!*

Make a phpinfo file(google for phpinfo), and check it for a configureation
path. It will probably be something like /etc/php.ini or /etc/php/php.ini,
or /this/that/something/else/php.ini. Open up this php.ini file and check
for the open_basedir

--- End Message ---
--- Begin Message ---
On 2/26/06, Schalk <[EMAIL PROTECTED]> wrote:
> Greetings All,
>
> I am pretty new to PHP and are tasked to move a clients site from:
>
> www.domain.com/somedirectory/home.php to www.home.php

If you're moving a clients site wouldn't your work be a better place
to ask? They will have processes etc to follow on how to do this and
will be able to help you a lot quicker than anyone here.

> Sounds simple at first but, when I moved the files to the root of the
> httpdocs I get an array of errors in the vain of:
> *Warning*: main(): open_basedir restriction in effect.
> File(../inc/siteconfig.php) is not within the allowed path(s):
> (/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs:/tmp) in
> /home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on line 1
>
> What exactly does this mean? I am sure there must be a config somewhere
> that has set it up to load from the sub directory and now it prevents it
> from loading from the root directory. Is this correct? What exactly does
> this error mean? Thanks to all!*

Open_basedir restricts where you can access files (see
http://www.php.net/features.safe-mode and search for 'open_basedir' to
tell you exactly what it does).

If you are in this folder:

/home/httpd/vhosts/domain.com/httpdocs

you are trying to include '../inc/siteconfig.inc.php'

so that means you are trying to access:

/home/httpd/vhosts/domain.com/inc/siteconfig.inc.php

which isn't in the open_basedir list (so php is stopping you).

Adjust the path to the 'siteconfig.inc.php' file and you should be right to go.

--- End Message ---
--- Begin Message ---
chris smith wrote:
On 2/26/06, Schalk <[EMAIL PROTECTED]> wrote:
Greetings All,

I am pretty new to PHP and are tasked to move a clients site from:

www.domain.com/somedirectory/home.php to www.home.php

If you're moving a clients site wouldn't your work be a better place
to ask? They will have processes etc to follow on how to do this and
will be able to help you a lot quicker than anyone here.

Sounds simple at first but, when I moved the files to the root of the
httpdocs I get an array of errors in the vain of:
*Warning*: main(): open_basedir restriction in effect.
File(../inc/siteconfig.php) is not within the allowed path(s):
(/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs:/tmp) in
/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on line 1

What exactly does this mean? I am sure there must be a config somewhere
that has set it up to load from the sub directory and now it prevents it
from loading from the root directory. Is this correct? What exactly does
this error mean? Thanks to all!*

Open_basedir restricts where you can access files (see
http://www.php.net/features.safe-mode and search for 'open_basedir' to
tell you exactly what it does).

If you are in this folder:

/home/httpd/vhosts/domain.com/httpdocs

you are trying to include '../inc/siteconfig.inc.php'

so that means you are trying to access:

/home/httpd/vhosts/domain.com/inc/siteconfig.inc.php

which isn't in the open_basedir list (so php is stopping you).

Adjust the path to the 'siteconfig.inc.php' file and you should be right to go.

Where is Open_basedir set? In a global php setting or can it be done site by site? And if so, what is the most logical place to put the file that controls this?

The reason I ask is because I have found a file called siteconfig.php located in the inc/ directory and below, please find it's contents.

<?
$template_title="Seal Beach Professionals - REFERRAL Networking Group";
$template_bgcolor="#4C4A4A";
$template_textcolor="#000000";
$template_bgpicture="../images/bg.gif";
$template_content_bgcolor="#FFFFFF";
$template_header_pic="../images/header.jpg";
$template_footer_pic="../images/footer_img.jpg";

$template_database_host="localhost";
$template_database="sealdata";
$template_databasen="sealuser";
$template_databasep="sealpass";
?>

I do not see anything here that will restrict it from running from either www.thedomain.com or www.thedomain.com/subfolder/

These all seem to be loading relative to root.

Thanks for everyones help so far.

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

--- End Message ---
--- Begin Message ---
> Where is Open_basedir set? In a global php setting or can it be done
> site by site? And if so, what is the most logical place to put the file
> that controls this?

It's set by apache and unless you have root access you don't have any
control over it.

Re-read the error message, php tells you all you need to know:

File(../inc/siteconfig.php) is not within the allowed path(s):
....
in /home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on line 1

So

The first line of home.php is:

include('../inc/siteconfig.php');

Change that.

--- End Message ---
--- Begin Message ---
Find your php.ini and read it.

Actually, find your httpd.conf and read it, because you can change
JUST DocumentRoot in httpd.conf, and not move any files around.

'Course, you'll have to put the files back, but you won't have to
change any of the paths embedded in the PHP web application.

On Sat, February 25, 2006 4:22 pm, Schalk wrote:
> Greetings All,
>
> I am pretty new to PHP and are tasked to move a clients site from:
>
> www.domain.com/somedirectory/home.php to www.home.php
>
> Sounds simple at first but, when I moved the files to the root of the
> httpdocs I get an array of errors in the vain of:
> *Warning*: main(): open_basedir restriction in effect.
> File(../inc/siteconfig.php) is not within the allowed path(s):
> (/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs:/tmp) in
> /home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on
> line 1
>
> What exactly does this mean? I am sure there must be a config
> somewhere
> that has set it up to load from the sub directory and now it prevents
> it
> from loading from the root directory. Is this correct? What exactly
> does
> this error mean? Thanks to all!*
> *
>
> --
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.President
> Volume4.Business.Solution.Developers
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
On Feb 25, 2006, at 2:22 PM, Schalk wrote:
*Warning*: main(): open_basedir restriction in effect. File(../inc/siteconfig.php) is not within the allowed path(s): (/home/httpd/vhosts/sealbeachprofessionals.com/httpdocs:/tmp) in /home/httpd/vhosts/sealbeachprofessionals.com/httpdocs/home.php on line 1

Try changing all includes that look like this:

include('/folder/file.php');

... to this:

include($_SERVER['DOCUMENT_ROOT'].'/folder/file.php');

--- End Message ---
--- Begin Message ---
To be more specific:

Based on error message you posted:

#Start from server root:
include($_SERVER['DOCUMENT_ROOT'].'/inc/siteconfig.php');

Hth,
gl, M

On Feb 25, 2006, at 7:31 PM, Michael Hulse wrote:

Try changing all includes that look like this:

include('/folder/file.php');

... to this:

include($_SERVER['DOCUMENT_ROOT'].'/folder/file.php');

--- End Message ---
--- Begin Message ---
I'm making the switch from Windows to Linux for mydesktop and
development environment and would greatly appreciate suggestions for
development tools on this platform. Ubuntu seems to be getting all the
press, but suggestions about Linux distributions are welcome as well!

c

--- End Message ---
--- Begin Message ---
On 2/26/06, Chris Lott <[EMAIL PROTECTED]> wrote:
> I'm making the switch from Windows to Linux for mydesktop and
> development environment and would greatly appreciate suggestions for
> development tools on this platform. Ubuntu seems to be getting all the
> press, but suggestions about Linux distributions are welcome as well!

That's a bit of a can of worms :) Everyone has different preferences.

Ubuntu or debian are good choices (ubuntu is kept more up to date, the
debian-stable branch only gets updated with security releases between
major versions).

Fedora is easy to use and set up.

They are both package based systems so unless you have a very specific
need from a package (eg with php you need the 'pcntl' functions) you
don't need to compile anything from source.

If you want to use a 'source package' system, I've been told Gentoo is
good (works much the same as freebsd) but I don't have any experience
with it.

--- End Message ---
--- Begin Message ---
On Sun, 26 Feb 2006 09:52:43 +1100, "chris smith" <[EMAIL PROTECTED]>
wrote:
> 
> Ubuntu or debian are good choices (ubuntu is kept more up to date, the
> debian-stable branch only gets updated with security releases between
> major versions).

Having said that, Debian Sid is usually pretty bleeding-edge.

And, although it is considered the 'Unstable' branch, it is nowhere
near as bas as people think.  I'm typing this e-mail on an amd64 box
running Debian Sid amd64, current uptime 54 days, last reboot due to
installing a new UPS.  But then again, one of my hats is SysAdmin, so I
can deal with update/upgrade issues better than the average end-user...

The only issue for me really is that Quanta has become a bit unstable
recently (a known bug, reported on Bugzilla) but other than that, I love
Debian.

My personal recommendation is Debian Stable (currently Sarge) for
mission-critical servers, Debian Testing (currently Etch) for
workstations, and Debian Unstable (always Sid) if you need the latest
and greatest on your workstation.  I do have a few servers running
Testing, but would not use Unstable on a mission-critical server.

We run Debian on just about all our work boxen. Heck, we even run
Debian on our SUN hardware...

Hope that helps.

Regards,
Ozz.

Attachment: pgpEeGzeVdJY1.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
On Sat, Feb 25, 2006 at 01:41:06PM -0900, Chris Lott wrote:
> I'm making the switch from Windows to Linux for mydesktop and
> development environment and would greatly appreciate suggestions for
> development tools on this platform. Ubuntu seems to be getting all the
> press, but suggestions about Linux distributions are welcome as well!

Before I get into what distib to use there are a few things i'd
like to point out:

  1) Avoid using the packaging system the OS provides for the
     developement server.  If you do, you will be under the control
     of the OS for your choice of versions of webserver, db server,
     php, or any dependency that is needed for those.

  2) Avoid using your desktop OS as your developement server.  With
     most distribs it is probably best you use the packaging system
     to manage upgrades and be on the latest package system avaiaible.


By following rule 1, it is rather easy to set up a system that can
handle multiple versions of any combination of your main tools
required for development.  For example, I have my development
machine able to test and run php apps with php 3.x, 4.x, 5.0.x and
5.1.x.. and soon perhaps php 6.x.  I can also control easily wich
version of apache I want to use, 1.x, 2.0.x  or 2.2.x. Of course db
mysql 4.1 or 5.0 and the latest pgsql.

For rule 2, what you work with vs what you are developing things
for on your devel server should be isolated. If you find out there
is a security update for Firefox and so you go and update your
system and silently it updated some libraries that were required by
one of your development apps, your development app will be upgraded
without you even knowing.

If you can't do rule 1 or 2 cause well you dont have the money for
two different machines, or you dont have the time to install
manually the developement apps needed, try to use a distrib for
the machine you plan on eventually publishing your code on.

I've never used Ubuntu, but another distrib i usually recommend is
Gentoo.  The learning curve for gentoo is probably a little high
but the package system is very flexible, and besides it is based on
the BSD port system :)


HTH,

Curt.
-- 
cat .signature: No such file or directory

--- End Message ---
--- Begin Message ---
> > I have some images in a database -- I mean, the actual data. There are no
> > files.
> >
> > I want to read Exif data for these images, but the read_exif_data()
> > function wants a file. I suppose I could write the images to temp files,
> > but that's a bit wasteful. And where would I write them? Is there a folder
> > I can count on being allowed to write to?
> >
> Answering myself: I solved this with tempnam(). I'm not completely sure
> about the portability, and of course it's a waste to write a file at all.
> And it could pose a security problem as well. Ho hum.

You only need to do it once - then store it back in the database. That
info isn't going to change.

When you store the image in the database you can get the info and store it then.

--- End Message ---
--- Begin Message ---
On Saturday 25 February 2006 23:42, chris smith wrote:

>> > I have some images in a database -- I mean, the actual data. There are
>> > no files.
>> >
>> > I want to read Exif data for these images, but the read_exif_data()
>> > function wants a file. I suppose I could write the images to temp
>> > files, but that's a bit wasteful. And where would I write them? Is
>> > there a folder I can count on being allowed to write to?
>> >
>> Answering myself: I solved this with tempnam(). I'm not completely sure
>> about the portability, and of course it's a waste to write a file at all.
>> And it could pose a security problem as well. Ho hum.
> 
> You only need to do it once - then store it back in the database. That
> info isn't going to change.
> 
> When you store the image in the database you can get the info and store it
> then.

No, I can't. I've got some images, with exif information in the DB. I'm now
generating thumbnails for them, and also storing those in the DB. No files
at all, and therefore I can't read exif data for the thumbnails.

As I said I've solved the problem by writing a temporary file and reading
exif from that. Not pretty or efficient, but it works.


//Niels

--- End Message ---
--- Begin Message ---
> >> Answering myself: I solved this with tempnam(). I'm not completely sure
> >> about the portability, and of course it's a waste to write a file at all.
> >> And it could pose a security problem as well. Ho hum.
> >
> > You only need to do it once - then store it back in the database. That
> > info isn't going to change.
> >
> > When you store the image in the database you can get the info and store it
> > then.
>
> No, I can't. I've got some images, with exif information in the DB. I'm now
> generating thumbnails for them, and also storing those in the DB. No files
> at all, and therefore I can't read exif data for the thumbnails.

So how do you GET the images into the database? from the filesystem
(whether you are uploading through a form or importing it, it's still
on the filesystem at some point). Generate the exif once (using your
tempnam workaround) then update the database.. so you only need to do
it once.

--- End Message ---
--- Begin Message ---
On Saturday 25 February 2006 23:55, chris smith wrote:

>> >> Answering myself: I solved this with tempnam(). I'm not completely
>> >> sure about the portability, and of course it's a waste to write a file
>> >> at all. And it could pose a security problem as well. Ho hum.
>> >
>> > You only need to do it once - then store it back in the database. That
>> > info isn't going to change.
>> >
>> > When you store the image in the database you can get the info and store
>> > it then.
>>
>> No, I can't. I've got some images, with exif information in the DB. I'm
>> now generating thumbnails for them, and also storing those in the DB. No
>> files at all, and therefore I can't read exif data for the thumbnails.
> 
> So how do you GET the images into the database? from the filesystem
> (whether you are uploading through a form or importing it, it's still
> on the filesystem at some point). Generate the exif once (using your
> tempnam workaround) then update the database.. so you only need to do
> it once.

I think you misunderstand the situation.

I've got a database of images (image data) and their exif data, I'm not
uploading any files. I want to make new entries in that DB, new images that
are thumbnails of the present images. I can do that without creating files,
but I can't get exif data of these thumbnails, because there are no files.
The exif data for the thumbnails isn't the same as for the full images.


//Niels

--- End Message ---
--- Begin Message ---
On 2/26/06, Bogdan Ribic <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>    I need to synchronize two postgresql servers, but synchronization is
> one-directional (ie, data from one computer needs to be copied to
> another). Basically, I want the target computer to drop the schema
> "public" and then re-create it from my dump made on the source machine.
> Is there an easy way to do it from PHP, perhaps using some postgre
> utility via system() call ?

err

pg_connect($connection_string);
pg_query("drop schema public");
...
import data
...

or am I missing something here?


You might be better of not doing this with php.

Create the dump on the first machine.
Copy the dump (scp, rsync, copy via samba-mounted drive, whatever)
import it

It depends what your end goal is.

--- End Message ---
--- Begin Message ---
Hello there, I am having an issue with HTML_QuickForm.
When I try to send the form to another page, it does not
seem to validate the form.

Any suggestions.



// Load the main class

require_once 'HTML/QuickForm.php';

// Instantiate the HTML_QuickForm object

$form = new HTML_QuickForm('firstForm', 'get', './somepage.html');

---- ELEMENTS / RULES ----

// validate form

if ($form->validate()) {

??   $form->submitValues();

   exit;

}



Thank you

Atif K

--- End Message ---
--- Begin Message ---
On 2/26/06, Atif Khan <[EMAIL PROTECTED]> wrote:
> Hello there, I am having an issue with HTML_QuickForm.
> When I try to send the form to another page, it does not
> seem to validate the form.
>
> Any suggestions.
>
>
>
> // Load the main class
>
> require_once 'HTML/QuickForm.php';
>
> // Instantiate the HTML_QuickForm object
>
> $form = new HTML_QuickForm('firstForm', 'get', './somepage.html');
>
> ---- ELEMENTS / RULES ----
>
> // validate form
>
> if ($form->validate()) {
>
> ??   $form->submitValues();
>
>    exit;
>
> }

I don't have an answer for you but you might be better off asking the pear list:

http://pear.php.net/support/lists.php

--- End Message ---

Reply via email to