Kallys / MediaDownloader

A WebUI for youtube-dl, implementing management for background downloads (queuing, concurrency...)
Other
75 stars 17 forks source link

can't install with caddy #19

Closed triaqu closed 4 years ago

triaqu commented 4 years ago

</html>session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/MediaDownloader/sources/lib/composer/bcosca/fatfree-core/base.php:1670) [/var/www/MediaDownloader/sources/app/lib/session.php:34] Base->clear() [/var/www/MediaDownloader/sources/app/lib/alerter.php:39] App\Lib\Session->Clear() [/var/www/MediaDownloader/sources/app/lib/alerter.php:41] Base->mutex() [/var/www/MediaDownloader/temp/1pv1bcbmkkohu.3pxdgdmcml0k4.php:50] App\Lib\Alerter::GetMessages() [/var/www/MediaDownloader/temp/1pv1bcbmkkohu.31g6l0jjtckk4.php:1] Preview->render() [/var/www/MediaDownloader/sources/app/controllers/install.php:22] Preview->render() [/var/www/MediaDownloader/sources/app/app.php:147] Base->run() [index.php:7] App\App->Run() <!DOCTYPE html>

Kallys commented 4 years ago

Please tell me which caddy version you are using.

triaqu commented 4 years ago

Caddy v1.0.3

Kallys commented 4 years ago

Ok, I just tried to install the same caddy version and it works without any issue. Please post here your Caddyfile and tell me when this error occurs.

triaqu commented 4 years ago

OS Debian 9 php 7.0

Caddyfile mydomain:443 { root /var/www/MediaDownloader/public tls my_key my_crt fastcgi / /var/run/php/php7.0-fpm.sock { ext .php split .php index index.php } }

'root@localhodt:/var/www/MediaDownloader# composer install Deprecation warning: Your package name kallys/MediaDownloader is invalid, it should not contain uppercase characters. We suggest using kallys/media-downloader instead. Make sure you fix this as Composer 2.0 will error. Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files root@localhost:/var/www/MediaDownloader# composer update Deprecation warning: Your package name kallys/MediaDownloader is invalid, it should not contain uppercase characters. We suggest using kallys/media-downloader instead. Make sure you fix this as Composer 2.0 will error. Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files root@localhost:/var/www/MediaDownloader# php index.php <!DOCTYPE html>

Media Downloader

Installation

Requirements
Name Value Status
php_version 7.0.33-0+deb9u5
mdc /var/www/MediaDownloader/mdc
logs /var/www/MediaDownloader/resources/logs/
databases /var/www/MediaDownloader/resources/databases/
sessions /var/www/MediaDownloader/resources/sessions/
temp /var/www/MediaDownloader/temp/
Administrator

Administrator is a super user in charge of setting up this server.

Server settings
Path to youtube-dl binary.
Path on this server where media will be downloaded to.
session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/MediaDownloader/sources/lib/composer/bcosca/fatfree-core/base.php:1670) [/var/www/MediaDownloader/sources/app/lib/session.php:34] Base->clear() [/var/www/MediaDownloader/sources/app/lib/alerter.php:39] App\Lib\Session->Clear() [/var/www/MediaDownloader/sources/app/lib/alerter.php:41] Base->mutex() [/var/www/MediaDownloader/temp/1pv1bcbmkkohu.3pxdgdmcml0k4.php:50] App\Lib\Alerter::GetMessages() [/var/www/MediaDownloader/temp/1pv1bcbmkkohu.31g6l0jjtckk4.php:1] Preview->render()[/var/www/MediaDownloader/sources/app/controllers/install.php:22] Preview->render()[/var/www/MediaDownloader/sources/app/app.php:147] Base->run() [index.php:7] App\App->Run() Media Downloader
'
Kallys commented 4 years ago

Ok, thanks.

Few things to progress:

  • First, run composer install in folder containing composer.json (MediaDownloader/ not MediaDownloader/public)
  • Then, you are not supposed to run this app in CLI mode: Don't run php index.php but use your web server instead: execute caddy inside MediaDownloader/public folder
  • Finally, you really shouldn't use your root user to perform all those steps (use www-data on debian)
triaqu commented 4 years ago

Hi.
Actually I run the composer in the folder of MediaDownloader and running the php is because the page localhost\install not found in the web browser.

Kallys commented 4 years ago

Hi, you're right composer should have complained about composer.json file if you weren't in right directory. Moreover, error logs indicate that FatFree is already installed.

Then, the next thing you need to do is to tell caddy that all URL should be rewrote to index.php. Moreover, you can add some logging lines if things don't go as expected:

mydomain:443 {
    root /var/www/MediaDownloader/public
    tls my_key my_crt
    log stdout
    errors stderr
    fastcgi / /var/run/php/php7.0-fpm.sock {
        ext .php
        split .php
        index index.php
    }
    rewrite {
        to {path} /index.php?{path}&{query}
    }
}

Next, if things still does not work, you can paste your caddy logs here (please use the "Insert code" syntax for better readability).

triaqu commented 4 years ago

Yes,it work.

Thank you.