Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Writing to file

Posted on 2000-03-25
2
Medium Priority
?
269 Views
Last Modified: 2006-11-17
I want to create a new php page from a form.

It works fine offline but when I upload on my server I've got those errors :

Warning: SAFE MODE Restriction in effect. The script whose uid is 98 is not allowed to access ./inc/top_nav.inc

I guess that's because my file should be executable... how could I do that?

    $fp = fopen("newfile.php3", "w");
    fputs($fp, "<HTML>\n");
    fputs($fp, "<HEAD>\n");
    fputs($fp, "<TITLE></TITLE> ");
    fputs($fp, "<? include(\"inc/top_nav.inc\");?>\n");  
    fputs($fp, stripslashes($Content));
    fputs($fp, "</BODY>\n");
    fputs($fp, "</HTML>\n");
    fclose($fp);

 
0
Comment
Question by:cybernietic
2 Comments
 
LVL 8

Expert Comment

by:us111
ID: 2657110
UID is the permissions of your script.
Do you have permissions to write into file on your server ?

try
<?
$o = fileowner("newfile.php3");
print "$o\n";
$o = fileowner("otherfile.php3");
print "$o\n";
?>
and look if the owner is the same.

and then.....wait.... for another comment (just for cibernietic : clear your quiche)

Euh, if you have full access to your server you can change the permissions otherwise it will hard.

Hmm my comment seems to be stupid. :)
0
 
LVL 12

Accepted Solution

by:
j2 earned 120 total points
ID: 2657324
Warning: SAFE MODE Restriction in effect. The script whose uid is 98 is not allowed to access ./inc/top_nav.inc

Means that the web process is running with UID 98, and when PHP has "safe mode" enabled, no UID > 1024 will be allowed to do thi.

Either you have to disable safemode
(safe_mode               =       Off) in php3.ini or you will have to move your webserver to run as a UID < 1024
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question