Php and asterisk permission problems

hi guys
i have a server with fedora core 6 and asterisk1.4 installed by ATPrpms, i have a php class for creationa .call file with chown and chmod functions. I have respected all requirements but when my php script create a .call and move on outgoing folder the server send this errors:

[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Invalid file contents in /var/spool/asterisk/outgoing/824_42665613.call, deleting
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Failed to scan service ‘/var/spool/asterisk/outgoing/824_42665613.call’
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Unable to open /var/spool/asterisk/outgoing/824_84670859.call: Permission denied, deleting
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Failed to scan service ‘/var/spool/asterisk/outgoing/824_84670859.call’
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Unable to open /var/spool/asterisk/outgoing/824_91405456.call: Permission denied, deleting
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Failed to scan service ‘/var/spool/asterisk/outgoing/824_91405456.call’
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Unable to open /var/spool/asterisk/outgoing/824_39740724.call: Permission denied, deleting
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Failed to scan service ‘/var/spool/asterisk/outgoing/824_39740724.call’
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Unable to open /var/spool/asterisk/outgoing/824_45980052.call: Permission denied, deleting
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: Failed to scan service ‘/var/spool/asterisk/outgoing/824_45980052.call’
[Feb 14 12:43:02] WARNING[3028] pbx_spool.c: At least one of app or extension must be specified, along with tech and dest in file

i’m confused, i dont understand if is a problem of the files or of the permissions settings, SELinux is disabled, and the php script work perfectly on another server with Debian and asterisk 1.2
any idea?

stop Asterisk, run the script and look at the permissions of the file. what are they ?

is it def. a move and not a copy that’s putting the file in the outgoing directory ?

ok
have an error on call file, i dont have addes Extension commad, and the script work i i call this on the shell, for example
php /var/www/html/test.php
the script create the call file and all work perfect, but if i call the file via web, not work, the chown commad on fedora core 6 non work. I have utliized chown() and exec and system functions but dont work.
i dont now if is the forum correct for this question, but if have any user with this problem, can you help me?

it sounds more likely that the user your httpd daemon runs as does not have permission to write the file to the directory.

depending on your setup (and never use root !!), you could use the same user you run Asterisk as to run httpd.

cinqusoft:

I had a similar problem. If I created my file in /tmp/… then it would fail with permissions problems on move to /var/spool/asterisk/outgoing/…

However if I create the file in /var/spool/asterisk/someotherdir/ then it copies over correctly.

Probably a permissions problem in a directory somewhere, but it works and I moved on, never did research it thoroughly.