Re: Create .php file with php
| From: | Daniel Brown | Date: | Tue, 26 Jun 2007 00:28:44 +0000 |
| Subject: | Re: Create .php file with php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257766@lists.php.net to get a copy of this message | ||
On 6/25/07, Marius Toma <marius@pro-websolutions.com> wrote:
I can not create .php files from PHP. I can save them as *.php5, *.php3, asp, *.txt , etc... but not as .php. I tried both touch and fopen but none of them worked. I'm running PHP 5.1.6 on Apache 2, safe_mode is off Is this a security measure somewhere? How can I bypass it? Thank you, Marius -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI doubt it will help you, but with a default installation of 5.2.2 on a Linux box (fresh install), I was able to do this from the CLI with no issues whatsoever: <?
$handle = fopen('writetest.php','w');
fwrite($handle,"This is a test.");
?>
I know that you said that you were able to write a file, but are
you using the correct parameters in your .php writes to create or
append to a file (as needed), and are the write permissions set
properly for the exact directory to which you're attempting to write?
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107