Jump to content

krazybob

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by krazybob

  1. Often times I will download the ticker file (that's what this is) and edit it offline. Then I'll upload it. This is what changed. Previously our ticker writer did what is was supposed to and on our Plkesk server the file was owned by siteadmin and psacln. Something changed and we don't know what. Regardless of being created by a script indirectly run by another script the file was not owned by apache. But now that something has changed I can download the file but not upload it back. I tried using chown and chmod from PHP but it fails. <?php if (file_exists('test.txt')) { unlink('test.txt'); // if it already exists let's erase it as a workaround } $fp = fopen('test.txt', 'w') or die("Unable to open file."); fwrite($fp, strftime('%c')."\r\n"); fclose($fp); chown('test.txt', 'scannerbuff'); ?> or <?php if (file_exists('test.txt')) { chown('test.txt', 'siteadmin'); } $fp = fopen('test.txt', 'w') or die("Unable to open file."); fwrite($fp, strftime('%c')."\r\n"); fclose($fp); chown('test.txt', 'siteadmin'); ?> What is another way I can change ownership to siteadmin?
  2. OK. But is it always owned by apache if a script creates it? ulink was just an experiement. But I've tried 0666 and it didn't work. Lemme try again.
  3. Until I switched to Plesk 9 I had no trouble writing a log file for an application that I wrote. It used PHP's FOPEN() command. It would write the file as the user. Now it does not write at all. If I run it manually it the file is owned by siteadmin but writes it as as root:root.. If I run it through a browser it is owned by apache:apache. What's changed? <?php if (file_exists('test.txt')) { unlink('test.txt'); // if it already exists let's erase it as a workaround } $fp = fopen('test.txt', 'w') or die("Unable to open file."); fwrite($fp, strftime('%c')."\r\n"); fclose($fp); ?> A similar block of code would write a ticker file that later would display on our pages. It was written and saved as the main site user, such as "siteadmin" on Plesk. Now PHP reports that it is unable to open or save the file. Permissions. We've changed nothing. This script has run since 2002 using chmod 644. We worked around this by creating an external script and using a CRON to write the file and this works fine. This suggests that the user has permission to open and write the file! Imagine our confusion. Don't laugh, but this server still has PHP 4.3.9, which adds to the confusion. It's run this way for years.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.