php-general Digest 3 Apr 2009 09:10:11 -0000 Issue 6046

Topics (messages 290983 through 291007):

Re: W3C Validator and Post Arrays
        290983 by: Ashley Sheridan
        290985 by: Paul M Foster
        290986 by: Michael A. Peters
        290993 by: tedd

Re: Java applet clearing session variables?
        290984 by: Bastien Koert

Re: [php] scheduled task in php
        290987 by: Andrew Williams
        291000 by: George Larson
        291001 by: Chris

Re: Oracle's dump to MySQL
        290988 by: Chris
        291007 by: 9el

Re: PHP LDAP over SSL problems
        290989 by: Chris

Re: php5-mhash disabled...
        290990 by: Chris

syntax woes
        290991 by: aurfalien.gmail.com
        290992 by: Chris
        290994 by: aurfalien.gmail.com
        290995 by: Ashley Sheridan
        290996 by: aurfalien.gmail.com
        290997 by: Ashley Sheridan
        290998 by: aurfalien.gmail.com
        290999 by: Chris
        291002 by: Shawn McKenzie
        291003 by: Shawn McKenzie
        291004 by: Chris
        291005 by: Michael A. Peters
        291006 by: aurfalien.gmail.com

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

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


----------------------------------------------------------------------
--- Begin Message ---
On Thu, 2009-04-02 at 14:23 -0400, tedd wrote:
> At 4:03 AM -0700 4/2/09, Michael A. Peters wrote:
> >Shaun Thornburgh wrote:
> >>Hi,
> >>
> >>We are getting errors when trying to vaildate 
> >>our HTML due to the [ character when using Post 
> >>Arrays:
> >>
> >>Line 173, Column 65:
> >>         character "[" is not allowed in the value of attribute "id"
> >>
> >>Še="filters[calling_url]" 
> >>id="filters[calling_url]" 
> >>value="categories-bulk-ear
> >>
> >>Does anyone know of a way around this?
> >>
> >>Thanks
> >
> >Don't use [] in an ID - it doesn't belong there.
> >If you are not using the ID for a hook, just 
> >drop it - the ID doesn't need to be there.
> >
> >The name attribute is where you want the [] to 
> >post an array, ID does not get sent in a post.
> 
> 
> Ahhh, no.
> 
> Try this:
> 
> http://www.webbytedd.com/bbb/check-box-form/
> 
> It works, shows why and how you can use [] and it validates.
> 
> Cheers,
> 
> tedd
> 
> -- 
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
You can use them in the name attribute like you said, but not in the id.
As id's all need to be unique, just output an incremental number next to
the text in the id property, sans [ characters.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
On Thu, Apr 02, 2009 at 02:25:55PM -0400, tedd wrote:

> At 4:03 AM -0700 4/2/09, Michael A. Peters wrote:
>> Shaun Thornburgh wrote:
>>> Hi,
>>>
>>> We are getting errors when trying to vaildate our HTML due to the [ 
>>> character when using Post Arrays:
>>>
>>> Line 173, Column 65:
>>>         character "[" is not allowed in the value of attribute "id"
>>>
>>> Še="filters[calling_url]" id="filters[calling_url]" 
>>> value="categories-bulk-ear
>>>
>>> Does anyone know of a way around this?
>>>
>>> Thanks
>>
>> Don't use [] in an ID - it doesn't belong there.
>> If you are not using the ID for a hook, just drop it - the ID doesn't need 
>> to be there.
>>
>> The name attribute is where you want the [] to post an array, ID does not 
>> get sent in a post.
>
>
> Correction -- name is Ok and where you should put the [].
>
> The demo is here:
>
> http://www.webbytedd.com/bbb/check-box-form/
>
> It works, shows why and how you can use [] and it validates.
>
> Cheers,
>
> tedd

I vote we scrap this list. Anyone with a question, just go to Tedd's
website. There's got to be an example on there somewhere. ;-}

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
tedd wrote:
At 4:03 AM -0700 4/2/09, Michael A. Peters wrote:
Shaun Thornburgh wrote:
Hi,

We are getting errors when trying to vaildate our HTML due to the [ character when using Post Arrays:

Line 173, Column 65:
        character "[" is not allowed in the value of attribute "id"

Še="filters[calling_url]" id="filters[calling_url]" value="categories-bulk-ear

Does anyone know of a way around this?

Thanks

Don't use [] in an ID - it doesn't belong there.
If you are not using the ID for a hook, just drop it - the ID doesn't need to be there.

The name attribute is where you want the [] to post an array, ID does not get sent in a post.


Correction -- name is Ok and where you should put the [].

I must be missing how that is a correction of my post ...

--- End Message ---
--- Begin Message ---
At 2:34 PM -0700 4/2/09, Michael A. Peters wrote:
tedd wrote:
At 4:03 AM -0700 4/2/09, Michael A. Peters wrote:
Shaun Thornburgh wrote:
Hi,

We are getting errors when trying to vaildate our HTML due to the [ character when using Post Arrays:

Line 173, Column 65:
        character "[" is not allowed in the value of attribute "id"

Se="filters[calling_url]" id="filters[calling_url]" value="categories-bulk-ear

Does anyone know of a way around this?

Thanks

Don't use [] in an ID - it doesn't belong there.
If you are not using the ID for a hook, just drop it - the ID doesn't need to be there.

The name attribute is where you want the [] to post an array, ID does not get sent in a post.


Correction -- name is Ok and where you should put the [].

I must be missing how that is a correction of my post ...

No, that was a correction to my post where I suggested that you were not correct, but you were. I was the one not being correct until I corrected myself and then agreed with you, understand?

Cheers,

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

--- End Message ---
--- Begin Message ---
On Thu, Apr 2, 2009 at 3:26 PM, Dan King <dan.king...@yahoo.com> wrote:

> It seems that our java applet is clearing our php session variables.
>
> I have an html form that saves user information as session variables. These
> session variables are used to create folders, where uploaded files can be
> saved. I've tested my php script that uses the session variables to create a
> folder and then moves uploaded files to that folder with a traditional html
> upload form.
> However, when I use a java applet in place of the traditional html form the
> php script does not create the folder, and thus it obviously cannot move the
> uploaded files.
>
> I've tested the applet and it does successfully upload files to the server.
> When I printed the session array variable after using the applet, I noticed
> the session array was empty. Does anyone know why this the applet clears the
> session variables? Or how to stop/work around it so I can use the applet and
> the php script?
>
> Thanks,
>
> Dan
>
>
>
>


Add the session hash to the page as a hidden field and revalidate
/regenerate the session when the page gets submitted?

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
I want to created a window schedule a task that will run every 2 minutes and
run my php script(www.domain.com/script.php).  But I need to know how to
create a php.exe that I can select as a window schedule a task so that the
php.exe file can execute www.domain.com/script.php at a time interval.
Solution please



On Thu, Apr 2, 2009 at 4:58 PM, Andrew Williams
<andrew4willi...@gmail.com>wrote:

>
>
> On Thu, Apr 2, 2009 at 2:06 PM, Virgilio Quilario <
> virgilio.quila...@gmail.com> wrote:
>
>> > Please how can you run a timed php script file via window scheduled
>> task. or
>> > how can u execute a php script on a a time interval for instance every
>> > 4minutes
>>
>> hi Andrew,
>>
>> first schedule a task, locate and select your php.exe, and schedule it
>> to run daily for the moment.
>> after creating it, you will see it listed on the window.
>> right click on it, and select properties.
>> on your Run box, add your script next to php.exe. ie
>> c:\path\to\php.exe myscript.php
>> click on schedule, click on advanced button, check on repeat task, put
>> 4 on every box, and finally click on ok, then apply button.
>>
>> that's it.
>>
>> cheers,
>> virgil
>> http://www.jampmark.com
>>
>
>
>
> --
> Best Wishes
> Andrew Williams
>
>
>


-- 
Best Wishes
Andrew Williams

--- End Message ---
--- Begin Message ---
On Thu, Apr 2, 2009 at 10:12 AM, Kyle Smith <kyle.sm...@inforonics.com>wrote:

> There's no need for third party software, windows has a scheduled task
> system.
>
> Make a scheduled task and for the application select the php executable
> (Maybe C:\PHP\bin\php.exe, or some such.).  Once the wizard is complete
> select the checkbox that says "Open the task when I click Finish".  Now
> place the full path of your script after the executable in the field
> provided so it looks something like:
>
> "C:\PHP\php.exe" "C:\Documents and Settings\Kyle\My
> Documents\scripts\MyCronPHPScript.php"
>
> HTH,
> Kyle
>
> *Kyle Smith*
> UNIX/Linux Systems Administrator
> Inforonics, LLC
>
>
>
> Jan G.B. wrote:
>
>> Or even with CRONw if "via window" is an indicator for the evil OS.
>> http://cronw.sourceforge.net/
>> (I personally didn't test this software)
>> bye
>>
>> 2009/4/2 Michel OLIVIER <michel.oliv...@mc2i.fr>:
>>
>>
>>> hi,
>>> with a cron and wget?
>>>
>>> 2009/4/2 Andrew Williams <andrew4willi...@gmail.com>:
>>>
>>>
>>>> All,
>>>>
>>>> Please how can you run a timed php script file via window scheduled
>>>> task. or
>>>> how can u execute a php script on a a time interval for instance every
>>>> 4minutes
>>>>
>>>> --
>>>> Best Wishes
>>>> Andrew Williams
>>>>
>>>>
>>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>>
>>
>>
>>
>

I have found Window's task scheduler utterly insufficient.  I understand,
and agree with, your desire to keep things native but I have thrown that
away for my scheduled events.  I swear bt VisualCron [
http://www.visualcron.com/].

--- End Message ---
--- Begin Message ---
Andrew Williams wrote:
I want to created a window schedule a task that will run every 2 minutes and
run my php script(www.domain.com/script.php).  But I need to know how to
create a php.exe that I can select as a window schedule a task so that the
php.exe file can execute www.domain.com/script.php at a time interval.
Solution please

You don't create a php.exe file, one should already be there from when you installed php.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
9el wrote:
I found this command from one guy for importing Oracle's dump to MySQL

Shell> mysql -uroot db_name -vvf < oracle_dump.dmp

But, v is for verbose and f is for force continuation.

Anyone worked with Oracle and MySQL?

Yep, and there's no way that will ever work except for the very simplest table and data.

The datatypes are different (mysql doesn't have varchar2, timestamp formats are different though oracle lets you change that).

You'll need to do a schema-only dump, convert it to the mysql format, then worry about converting the data.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
On Fri, Apr 3, 2009 at 3:47 AM, Chris <dmag...@gmail.com> wrote:

> 9el wrote:
>
>> I found this command from one guy for importing Oracle's dump to MySQL
>>
>> Shell> mysql -uroot db_name -vvf < oracle_dump.dmp
>>
>> But, v is for verbose and f is for force continuation.
>>
>> Anyone worked with Oracle and MySQL?
>>
>
> Yep, and there's no way that will ever work except for the very simplest
>  table and data.
>
> The datatypes are different (mysql doesn't have varchar2, timestamp formats
> are different though oracle lets you change that).
>
> You'll need to do a schema-only dump, convert it to the mysql format, then
> worry about converting the data.


Yes, before writing the mail I had this confusion but as my
max_packet_allowed was default to 16M I couldn't have been able to continue
with 28M dump from Oracle.
Now that I have the schema in MySQL already. What can I do to get data only
from Oracle's DB?
There are lots of software tools out there but I want to learn it from the
base. I cant afford to buy any software either.


>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>

--- End Message ---
--- Begin Message ---
Keith Lawson wrote:
Hello, I have been working on this problem for some time now and I can't seem to resolve it. Everything I have found on google and php.net says I can connect to an LDAP server with SSL by setting "TLS_REQCERT never" in ldap.conf. I want to eliminate certs from the picture for now just to confirm I can make the connection which is why I have "TLS_REQCERT never" set. I added that setting to my ldap.conf and my test code now works from the command line but it does not work when I call it from a browser. Here is my test:
<?php
$ldaphost = "ldaps://my.ldap.server";

//ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
// Connecting to LDAP
$ldapconn = ldap_connect($ldaphost)
          or die("Could not connect to {$ldaphost}");
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);

echo var_dump(@ldap_bind($ldapconn, "cn=Keithl, ou=Users, o=LH"));

It's hard to know - you're suppressing errors.

Add these 2 lines to your script:
error_reporting(E_ALL);
ini_set('display_errors', true);

Then get rid of the @ in front of ldap_bind.

Use http://www.php.net/manual/en/function.ldap-error.php to capture the error message and search for it.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
Anders Norrbring wrote:
I just saw that mhash is disabled in the spec file for php5 if SUSE version
is 11.0 or higher.
Simple question, does it do any harm?

If they decided to do that it's best to ask suse (or on the opensuse lists if you're using that flavour).

It may just be because it's deprecated but it could be for some other reason (eg binary compatibility issues or licensing issues or .. ).

--
Postgresql & php tutorials
http://www.designmagick.com/

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

I'm unsure how to describe this but I'll try.

The following code works fine in its own PHP script;

$mkdircmd = '/bin/mkdir /homes/'.$uid;
exec($mkdircmd);

But when placed in a larger PHP script being part of the ldap_provisioning module in Drupal, the Drupal GUI is blank until I do;

$mkdircmd = "'/bin/mkdir /homes/'.$uid";

... were I surrounded the variable with "", which causes it to not work.

I'm totally unsure how to approach this and am hoping syntax adjustments will fix it.

- aurf

--- End Message ---
--- Begin Message ---
aurfal...@gmail.com wrote:
Hi all,

I'm unsure how to describe this but I'll try.

The following code works fine in its own PHP script;

$mkdircmd = '/bin/mkdir /homes/'.$uid;
exec($mkdircmd);

But when placed in a larger PHP script being part of the ldap_provisioning module in Drupal, the Drupal GUI is blank until I do;

$mkdircmd = "'/bin/mkdir /homes/'.$uid";

... were I surrounded the variable with "", which causes it to not work.

$mkdircmd = "/bin/mkdir /homes/$uid";
or
$mkdircmd = "/bin/mkdir /homes/${uid}";

Should fix the syntax.

I guess you've already solved the permissions problem on the /homes/ folder (normally the web server would not be able to create such a path because of permission issues).

Blank GUI - no idea. Anything in the error logs (php or apache) ?

Maybe asking on a drupal specific list would be a better idea for that one.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
aurfal...@gmail.com wrote:
Hi all,
I'm unsure how to describe this but I'll try.
The following code works fine in its own PHP script;
$mkdircmd = '/bin/mkdir /homes/'.$uid;
exec($mkdircmd);
But when placed in a larger PHP script being part of the ldap_provisioning module in Drupal, the Drupal GUI is blank until I do;
$mkdircmd = "'/bin/mkdir /homes/'.$uid";
... were I surrounded the variable with "", which causes it to not work.

$mkdircmd = "/bin/mkdir /homes/$uid";
or
$mkdircmd = "/bin/mkdir /homes/${uid}";

Should fix the syntax.

I guess you've already solved the permissions problem on the /homes/ folder (normally the web server would not be able to create such a path because of permission issues).

Blank GUI - no idea. Anything in the error logs (php or apache) ?

Maybe asking on a drupal specific list would be a better idea for that one.

--
Postgresql & php tutorials
http://www.designmagick.com/

Thanks Chris.

I appreciate the response. I was hoping my description wasn't too vague because I don't really understand what I'm doing.

- aurf



--- End Message ---
--- Begin Message ---
On Thu, 2009-04-02 at 15:47 -0700, aurfal...@gmail.com wrote:
> > aurfal...@gmail.com wrote:
> >> Hi all,
> >> I'm unsure how to describe this but I'll try.
> >> The following code works fine in its own PHP script;
> >> $mkdircmd = '/bin/mkdir /homes/'.$uid;
> >> exec($mkdircmd);
> >> But when placed in a larger PHP script being part of the  
> >> ldap_provisioning module in Drupal, the Drupal GUI is blank until I  
> >> do;
> >> $mkdircmd = "'/bin/mkdir /homes/'.$uid";
> >> ... were I surrounded the variable with "", which causes it to not  
> >> work.
> >
> > $mkdircmd = "/bin/mkdir /homes/$uid";
> > or
> > $mkdircmd = "/bin/mkdir /homes/${uid}";
> >
> > Should fix the syntax.
> >
> > I guess you've already solved the permissions problem on the /homes/  
> > folder (normally the web server would not be able to create such a  
> > path because of permission issues).
> >
> > Blank GUI - no idea. Anything in the error logs (php or apache) ?
> >
> > Maybe asking on a drupal specific list would be a better idea for  
> > that one.
> >
> > -- 
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> 
> Thanks Chris.
> 
> I appreciate the response.  I was hoping my description wasn't too  
> vague because I don't really understand what I'm doing.
> 
> - aurf
> 
> 
> 
This might sound stupid because I've not played with Drupal, but what's
wrong with using the mkdir command in PHP instead of the exec call?


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
On Thu, 2009-04-02 at 15:47 -0700, aurfal...@gmail.com wrote:
aurfal...@gmail.com wrote:
Hi all,
I'm unsure how to describe this but I'll try.
The following code works fine in its own PHP script;
$mkdircmd = '/bin/mkdir /homes/'.$uid;
exec($mkdircmd);
But when placed in a larger PHP script being part of the
ldap_provisioning module in Drupal, the Drupal GUI is blank until I
do;
$mkdircmd = "'/bin/mkdir /homes/'.$uid";
... were I surrounded the variable with "", which causes it to not
work.

$mkdircmd = "/bin/mkdir /homes/$uid";
or
$mkdircmd = "/bin/mkdir /homes/${uid}";

Should fix the syntax.

I guess you've already solved the permissions problem on the /homes/
folder (normally the web server would not be able to create such a
path because of permission issues).

Blank GUI - no idea. Anything in the error logs (php or apache) ?

Maybe asking on a drupal specific list would be a better idea for
that one.

-- Postgresql & php tutorials
http://www.designmagick.com/

Thanks Chris.

I appreciate the response.  I was hoping my description wasn't too
vague because I don't really understand what I'm doing.

- aurf



This might sound stupid because I've not played with Drupal, but what's
wrong with using the mkdir command in PHP instead of the exec call?


Ash
www.ashleysheridan.co.uk


Hi Ash,

I didn't know there was one.

Lemme study it up, thanks for the suggestion.

- aurf

--- End Message ---
--- Begin Message ---
On Thu, 2009-04-02 at 15:58 -0700, aurfal...@gmail.com wrote:
> > On Thu, 2009-04-02 at 15:47 -0700, aurfal...@gmail.com wrote:
> >>> aurfal...@gmail.com wrote:
> >>>> Hi all,
> >>>> I'm unsure how to describe this but I'll try.
> >>>> The following code works fine in its own PHP script;
> >>>> $mkdircmd = '/bin/mkdir /homes/'.$uid;
> >>>> exec($mkdircmd);
> >>>> But when placed in a larger PHP script being part of the
> >>>> ldap_provisioning module in Drupal, the Drupal GUI is blank until I
> >>>> do;
> >>>> $mkdircmd = "'/bin/mkdir /homes/'.$uid";
> >>>> ... were I surrounded the variable with "", which causes it to not
> >>>> work.
> >>>
> >>> $mkdircmd = "/bin/mkdir /homes/$uid";
> >>> or
> >>> $mkdircmd = "/bin/mkdir /homes/${uid}";
> >>>
> >>> Should fix the syntax.
> >>>
> >>> I guess you've already solved the permissions problem on the /homes/
> >>> folder (normally the web server would not be able to create such a
> >>> path because of permission issues).
> >>>
> >>> Blank GUI - no idea. Anything in the error logs (php or apache) ?
> >>>
> >>> Maybe asking on a drupal specific list would be a better idea for
> >>> that one.
> >>>
> >>> --  
> >>> Postgresql & php tutorials
> >>> http://www.designmagick.com/
> >>
> >> Thanks Chris.
> >>
> >> I appreciate the response.  I was hoping my description wasn't too
> >> vague because I don't really understand what I'm doing.
> >>
> >> - aurf
> >>
> >>
> >>
> > This might sound stupid because I've not played with Drupal, but  
> > what's
> > wrong with using the mkdir command in PHP instead of the exec call?
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> 
> 
> Hi Ash,
> 
> I didn't know there was one.
> 
> Lemme study it up, thanks for the suggestion.
> 
> - aurf
> 
PHP can do everything ;)


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
On Thu, 2009-04-02 at 15:58 -0700, aurfal...@gmail.com wrote:
On Thu, 2009-04-02 at 15:47 -0700, aurfal...@gmail.com wrote:
aurfal...@gmail.com wrote:
Hi all,
I'm unsure how to describe this but I'll try.
The following code works fine in its own PHP script;
$mkdircmd = '/bin/mkdir /homes/'.$uid;
exec($mkdircmd);
But when placed in a larger PHP script being part of the
ldap_provisioning module in Drupal, the Drupal GUI is blank until I
do;
$mkdircmd = "'/bin/mkdir /homes/'.$uid";
... were I surrounded the variable with "", which causes it to not
work.

$mkdircmd = "/bin/mkdir /homes/$uid";
or
$mkdircmd = "/bin/mkdir /homes/${uid}";

Should fix the syntax.

I guess you've already solved the permissions problem on the / homes/
folder (normally the web server would not be able to create such a
path because of permission issues).

Blank GUI - no idea. Anything in the error logs (php or apache) ?

Maybe asking on a drupal specific list would be a better idea for
that one.

-- Postgresql & php tutorials
http://www.designmagick.com/

Thanks Chris.

I appreciate the response.  I was hoping my description wasn't too
vague because I don't really understand what I'm doing.

- aurf



This might sound stupid because I've not played with Drupal, but
what's
wrong with using the mkdir command in PHP instead of the exec call?


Ash
www.ashleysheridan.co.uk


Hi Ash,

I didn't know there was one.

Lemme study it up, thanks for the suggestion.

- aurf

PHP can do everything ;)


Ash
www.ashleysheridan.co.uk



Wow, it does chown and chmod as well, thats friggen cool.

Ok, then, I'm sold, PHP can do everything...

... but save us from ourselves. Sorry, I had to kik that in. Tech will be the death of us all, wahahahahahaaaaa :)

- aurf




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

Wow, it does chown and chmod as well, thats friggen cool.

chown will only work if the script is running as root which I doubt your drupal site will be.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
Chris wrote:
> 
>> Wow, it does chown and chmod as well, thats friggen cool.
> 
> chown will only work if the script is running as root which I doubt your
> drupal site will be.
> 

Or if the script is running as a user/group that has write permissions
to the dir/file that your trying to chown.

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
Chris wrote:
> 
>> Wow, it does chown and chmod as well, thats friggen cool.
> 
> chown will only work if the script is running as root which I doubt your
> drupal site will be.
> 

Or if the script is running as a user/group that has write permissions
to the dir/file that your trying to chown.

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
Chris wrote:
Wow, it does chown and chmod as well, thats friggen cool.
chown will only work if the script is running as root which I doubt your
drupal site will be.


Or if the script is running as a user/group that has write permissions
to the dir/file that your trying to chown.

chmod may allow that, but not chown.

server:~# groupadd test
server:~# useradd a -g test
server:~# useradd b -g test
server:~# mkdir /test
server:~# chown a.test /test
server:~# su - a
No directory, logging in with HOME=/
a...@server:/$ cd test
a...@server:/test$ chmod 775 .
a...@server:/test$ touch a
a...@server:/test$ chmod 664 a
a...@server:/test$ chown b.test a
chown: changing ownership of `a': Operation not permitted
a...@server:/test$


--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
Chris wrote:
Shawn McKenzie wrote:
Chris wrote:
Wow, it does chown and chmod as well, thats friggen cool.
chown will only work if the script is running as root which I doubt your
drupal site will be.


Or if the script is running as a user/group that has write permissions
to the dir/file that your trying to chown.

chmod may allow that, but not chown.



I believe it depends upon the operating system and version of the operating system.
--- End Message ---
--- Begin Message ---
Hi all,

For any one following this thread, here is how I worked around the apache/php/chown limitation.

script snippet (and if any one has a more elegant style, please share as I am an amateur script kiddie).

$path = "/homes".$username;
$chowncmd = "/usr/bin/sudo /bin/chown ";
mkdir($path);
chmod($path, 0775);
exec($chowncmd.$username. " ".$path);


I modified /etc/sudoers;

#Defaults requiretty   - I added the comment.
apache ALL = NOPASSWD: /bin/chown  - added this line.

- aurf
On Apr 2, 2009, at 6:58 PM, Michael A. Peters wrote:

Chris wrote:
Shawn McKenzie wrote:
Chris wrote:
Wow, it does chown and chmod as well, thats friggen cool.
chown will only work if the script is running as root which I doubt your
drupal site will be.


Or if the script is running as a user/group that has write permissions
to the dir/file that your trying to chown.
chmod may allow that, but not chown.

I believe it depends upon the operating system and version of the operating system.

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



--- End Message ---

Reply via email to