httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] cgi script unable to create files on server.
Date Sun, 12 Apr 2009 12:14:40 GMT
Hi jamal.

Please keep responding to the list, not to me personally.

I cannot tell you for Vista.
For XP it would be like this :
Assuming that you are running Apache as a Service :
Right-click on the "My Computer" icon, choose "Manage".
In the Window that appears, find "Services" and click on it.
In the list on the right, you should see "Apache ...".
Right-click on that.
This will give you a window with several tabs. One of them is named 
"Logon as...". That is where it is marked under which user-id Apache is 
starting. By default, it is probably set to "Local System".
That is a special user-id which can do many things on the local system, 
but has for example no access to network resources.
Anyway, that is the user-id under which Apache is running.

Before you go changing this however, please check what your script is 
really trying to do, and why it is getting an error.  In other words, 
make your error message (in the script) more descriptive :
- what is the file it is trying to open (full path)
- what error is it getting when trying to open the file (permission, 
file not found, directory not found,.. ?)


m jamal wrote:
> OS is Windows Vista.How can i give that user id permission.The problem occurs only when
apache runs the script.general c++ programs are able to create files.
> 
> --- On Sun, 4/12/09, André Warnier <aw@ice-sa.com> wrote:
> 
> From: André Warnier <aw@ice-sa.com>
> Subject: Re: [users@httpd] cgi script unable to create files on server.
> To: "m jamal" <mjamal_nasir@yahoo.com>
> Date: Sunday, April 12, 2009, 4:53 PM
> 
> m jamal wrote:
>> It says "could not open database".This is same error message which i have coded my
script to show when it fails to open file.
>>
> Isn't that an amazing coincidence ?
> ;-)
> So, it looks like it's not Apache having a problem, it is your script.
> (Tip : whatever your script write to STDERR, will appear in the Apache error log.)
> Another tip : when Apache runs your script, it does so under the user-id under which
Apache itself runs.
> You have not told us under which OS this all happens, but if it is Unix/Linux, try a
"ps" command to see which user that is.
> Does that user-id have the permissions to open the database ?
> You may also want to make your script print a more descriptive error, such as why it
cannot open the database.
> 
> 
> 
>> --- On Sun, 4/12/09, André Warnier <aw@ice-sa.com> wrote:
>>
>> From: André Warnier <aw@ice-sa.com>
>> Subject: Re: [users@httpd] cgi script unable to create files on server.
>> To: users@httpd.apache.org
>> Date: Sunday, April 12, 2009, 4:09 PM
>>
>> m jamal wrote:
>>> I am new to apache.The problem is that when i run a cgi script written in c++,all
scripts run fine except those which create a file on server computer.For example i have written
a script that creates a file to store user info.It runs fine.It collects info but when it
tries to create a file to store that info apache  gives an internal server error.Please help
how to solve this problem.I have wasted lot of time but unable to find any solution.I am using
apache v2.2.11.
>>>
>> What does the Apache error log file say ?
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
>>
>>        
> 
> 
> 
> 
>       


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message