php-general Digest 23 Dec 2001 16:04:34 -0000 Issue 1069

Topics (messages 78607 through 78616):

Help with permissions/ownership
        78607 by: Gaylen Fraley

mail function not support in php 4.1.0 with compiled with IMAP ???
        78608 by: Martin Fienkeng

Re: strtoupper and HTML entities
        78609 by: mweb

How to parse an XML document
        78610 by: PHP Rules
        78614 by: James Cox

Re: PHP called recursively?
        78611 by: Thomas Karcher

Accessing a php file in a frame
        78612 by: artfakt

Build questions
        78613 by: Andrey Hristov

How to compile Apache/PHP
        78615 by: Todd Cary

Prev ... Next
        78616 by: Rambo Amadeus

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:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I'll try to be both concise and precise with this.

I have some PHP code like this:

 if (!rename($path_to_file,$path_to_file_BACKUP))
die("$unable_to_access_file_msg $path_to_file_BACKUP");
 $buffersize = round(filesize($path_to_file_BACKUP)*1.5);
 $fp_in = fopen("$path_to_file_BACKUP","r") or
die("$unable_to_access_file_msg $path_to_file_BACKUP");
 $fp = fopen("$path_to_file",'a') or die("$unable_to_access_file_msg
$path_to_file");
 set_file_buffer($fp,$buffersize);
 fwrite($fp,"hello") or die("HELP!");
 fclose($fp);

This works, sort of.  It dies with HELP!  The rename happens exactly as
required.  However, when PHP creates the $fp file, the owner and permissions
are different.  I can chmod the permissions, through PHP
(chmod($path_to_file,0777) , but I can't seem to change the owner, using
chown (it says it is not allowed).  The original file, before being renamed
and the directory are 0777.  After the rename, the old file is still 0777,
but the new file ($fp) is 0644.  It appears that the new owner is the root
directory for the server document (in this case 1792=www), instead of the
group.  As an example, before the rename, the owner is 1444 as is the group.
When $fp is created, the owner is now 1792 but the group is still 1444 (user
name of the ftp account).

On most systems, this seems to work ok. But on some linux systems, it fails
due to the ownership.  The PHP program cannot write to the new file.  I'm
hoping that I'm overlooking some minor/major factor here, that someone
will/can point out.  How does PHP, or is it the server, get ownership?

I hope this make sense.

Thanks!

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/



--- End Message ---
--- Begin Message ---
I just finished installing php 4.1.0 with the following options
with-imap, with-expat, with-mysql and with-apxs
my system is Mandrake 8.1

I tried using the mail function to send mail out and this is the error I get 
"Warning: mail() is not supported in this PHP build in content on line 26"

Is it that in compiling with imap I loose the mail function? or is there 
another switch to activate this

Any help in resolving this will be greatly appreciated

Martin Fienkeng
"Just searching for more knowledge"


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
It works!

thanks a lot, Michael!!

                mweb

On Sunday 23 December 2001 00:41, Michael Sims wrote:
> At 11:32 PM 12/22/2001 +0100, mweb wrote:
> >Hello,
> >
> >I know I can convert a string to all uppercases with the strtoupper()
> >function. However, what if the original string contains HTML entities?
> >
> >EXAMPLE:
> >
> >original string = "funkstörung"
>
> Try this:
>
> <?
> function htmltoupper($str) {
>          $trans = get_html_translation_table (HTML_ENTITIES);
>          $trans = array_flip ($trans);
>          $str = strtr ($str, $trans);
>          $str = strtoupper($str);
>          $str = htmlentities($str);
>          return $str;
> }
>
> $string = "funkst&ouml;rung";
>
> $string = htmltoupper($string);
>
> echo $string;
> ?>
--- End Message ---
--- Begin Message ---
Hi fellas.

I would like to know the way to parse an XML document.

I come from Java world, and you can handle an XML document,
and 
then show it as an HTML page.

I suppose that it's also possible by using PHP, isn't it?

I would like also to know if it's available in the 'standard
installation' of PHP. I mean, I want to develop this on a
remote
server. It uses PHP, and I suppose that it's not installated
any
extra module, so I wonder if the XML parsing needs any extra
module
or not.

Best regards.
_______________________________________________________________________
¿Sabes que puedes redireccionar tu correo de HispaVista a donde tú quieras?
http://www.hispavista.com/altascorreo/
--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/ref.xml.php

HTH.

James Cox


> -----Original Message-----
> From: PHP Rules [mailto:[EMAIL PROTECTED]]
> Sent: 23 December 2001 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to parse an XML document
>
>
> Hi fellas.
>
> I would like to know the way to parse an XML document.
>
> I come from Java world, and you can handle an XML document,
> and
> then show it as an HTML page.
>
> I suppose that it's also possible by using PHP, isn't it?
>
> I would like also to know if it's available in the 'standard
> installation' of PHP. I mean, I want to develop this on a
> remote
> server. It uses PHP, and I suppose that it's not installated
> any
> extra module, so I wonder if the XML parsing needs any extra
> module
> or not.
>
> Best regards.
> _______________________________________________________________________
> ¿Sabes que puedes redireccionar tu correo de HispaVista a donde
> tú quieras?
> http://www.hispavista.com/altascorreo/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

--- End Message ---
--- Begin Message ---
Hi Chris,

> if he wants to burn a cd why dont you just copy the php dir onto a cd? why
> do you have to parse everything? as an admin I would rather the entire dir
> then the content of the executed script. plus on your side parseing every
> url recursivly and getting all the images etc, what a hasle, just copy the
> dir ..

But the PHP scripts generate HTML content out of a database - and as far as
I know it is not very easy to run a database and a webserver on a CD   ;->
Yes, it is possible, I know, but these CD's are given to his customers, so
it must be easy to use ...
And yes, at this time, I am parsing the content for substituting image
paths, CSS paths and so on ...

In the meantime, I had to solve the problem, so I did it via
fopen(http://server/php-script.php4), but I am interested why it doesn't
work with an "embedded" PHP script.

Thanks!
Thomas


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

I have a file.html with a frame which target file.php
I can access to file.php : localhost/file.php : ok
I can access to file.html but the frame which target file.php display 
"forbidden ...

?       thanks          [EMAIL PROTECTED]


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--- End Message ---
--- Begin Message ---
Hi,

I've some questions about building PHP on Win platform.
I use VC++6.0 and load workspace from the win32 directory. After loading I looked at 
the configurations and found that there many.
Which one to choose? I want to make some experiments on win32 platform using Apache as 
a webserver(so no thread enviroment). I
suppose that I've to build php4ts because my current Apache/php config uses this dll 
in company of php4ts.lib.
Last question : Why the compile time is bigger in times compared to linux?

TIA

Andrey Hristov


--- End Message ---
--- Begin Message ---
I am quite new to the Linux environment and do not have experience with
"make" files.  The platform is RH Linux 7.2 with the included Apache and
the PHP rpm, "php-devel-4.0.4pl1-9.i386.rpm".  I need someone to give me
the step by step process of creating a version of Apache that will
process PHP extensions.

Many thanks..........

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Hi,
I have about 100 names in mysql. How can i display them in groups of 10, and
have next and previous links.

Thanks

--- End Message ---

Reply via email to