fork(1) download
  1. <?php
  2. require "/vendor/autoload.php";
  3.  
  4. use \Slim\Slim as Slim;
  5.  
  6. $app = new Slim();
  7.  
  8.  
  9. $app->config(array(
  10. 'templates.path' => 'templates/'
  11. ));
  12.  
  13. $app->render('header.tpl');
  14.  
  15. $app->get('/', function() use ($app) {
  16. $app->render('main.tpl');
  17. });
  18.  
  19. $app->get('/upload', function() use ($app) {
  20. $app->render('upload.tpl');
  21. })->name("upload");
  22.  
  23. $app->post('/', function() use ($app) {
  24. $uploaddir = "uploads/";
  25. $temp = $_FILES['file']['name'];
  26. $uploadfile = $uploaddir . $temp;
  27.  
  28. move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile);
  29.  
  30. $app->flash('message','Файл загружен!');
  31.  
  32. $app->redirect($app->urlFor('upload'), '303');
  33. });
  34.  
  35. $app->render('footer.tpl');
  36.  
  37. $app->run();
Runtime error #stdin #stdout #stderr 0.01s 20520KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  session_start(): open(/var/lib/php5/sess_lh6c8slkm6co2udjfe2651iqj3, O_RDWR) failed: Permission denied (13) in /home/wWctBJ/prog.php on line 2
PHP Warning:  require(/vendor/autoload.php): failed to open stream: No such file or directory in /home/wWctBJ/prog.php on line 3
PHP Fatal error:  require(): Failed opening required '/vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/wWctBJ/prog.php on line 3
PHP Warning:  Unknown: open(/var/lib/php5/sess_lh6c8slkm6co2udjfe2651iqj3, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php5) in Unknown on line 0