Jump to content

Recommended Posts

Sorry guys but need a tech input here.

 

I use a windows based PC to write my php website. I believe that there are several types of php website. I can have a proper unix based website or I can have a dreaded MICROSOFT website with apache webserver running on it. I had a website some time ago and it was running slow. I noticed that it had a strange folder in it .NET. I challenged the company over this. They admitted that my website was actually running on windows server.  I find myself in the same situation again. I am told that this website is realty on a Unix box. 

 

Problem is, some code that works on a genuine Unix server, does NOT work when transferred to the new website. Can any of you guys shed some light on this or tell me if I am going insane.

 

<?php
$fp = fopen('desmond.txt', 'a');
fwrite($fp, 'Top o the morning to ya');
fclose($fp);
echo ("Hi Guys");
?>

 

 

This does not work on the new website. I used to write old style C code and fopen() and used the Brian Kernighan and Dennis Ritchie code. Is this something that does not work on a windows based system. Can I find out what is going on.

 

Desmond.

Link to comment
https://forums.phpfreaks.com/topic/188728-to-be-or-not-to-be-unix/
Share on other sites

returns

Linux ns.rockhost5.co.uk 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:27:37 EST 2009 x86_64

I know what you are going to say next but fopen() is not working on the new website

The file permissions haver been set to:

httpdocs =

drwxrwxrwx which is probably the same as your

1777 the one being I am a directory as aposed to 0 I am a file.

 

 

if PHP fails to do something it will report and error assuming error reporting  is on.

try

error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
$fp = fopen('desmond.txt', 'a');
fwrite($fp, 'Top o the morning to ya');
fclose($fp);
echo ("Hi Guys");

Whats the error ?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.