Re: syntax woes

From: Date: Thu, 02 Apr 2009 23:08:32 +0000
Subject: Re: syntax woes
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-290998@lists.php.net to get a copy of this message
On Thu, 2009-04-02 at 15:58 -0700, aurfalien@gmail.com wrote:
On Thu, 2009-04-02 at 15:47 -0700, aurfalien@gmail.com wrote:
aurfalien@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

« previous php.general (#290998) next »