wiki:os:debian:apache2_put
This is an old revision of the document!
Apache2 a metoda PUT
root@server:~# a2enmod actions
root@server:~# nano /etc/apache2/sites-available/default
- /etc/apache2/sites-available/default
... <Directory /> Options FollowSymLinks AllowOverride None Script PUT /put.php </Directory> ...
root@server:~# service apache restart
- put.php
<?php /* PUT data comes in on the stdin stream */ $putdata = fopen("php://input", "r"); /* Open a file for writing */ $fp = fopen("var/www/test.xml", "w"); /* Read the data 1 KB at a time and write to the file */ while ($data = fread($putdata, 1024)) fwrite($fp, $data); /* Close the streams */ fclose($fp); fclose($putdata); ?>
Nastavení práv do kterého si PHP zapíše data přijatá metodou PUT:
root@server:~# chmod 766 /var/www/test.xml
root@server:~# curl -i -X PUT -T “/var/www/DATA.xml” http://localhost/put.php
wiki/os/debian/apache2_put.1349469159.txt.gz · Last modified: (external edit)
