forked from chaosarium/lwt
-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
Describe the bug
Reading a text might result in this error:
[Mon Jan 10 17:40:52 2022] PHP 7.4.12 Development Server (http://localhost:9004) started
[Mon Jan 10 17:40:54 2022] [::1]:53495 Accepted
[Mon Jan 10 17:40:54 2022] [::1]:53495 [500]: GET /do_text.php?start=1 - require_once(): Failed opening required 'vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php' (include_path='.:/Applications/MAMP/bin/php/php7.4.12/lib/php') in /Users/username/vendor/hugofara/lwt/do_text.php on line 15
[Mon Jan 10 17:40:54 2022] [::1]:53495 Closing
To Reproduce
(I'm not sure if this is the proper way to set up lwt. But since MAMP doesn't come with composer, I followed this guide and put composer.phar in ~/
composer require hugofara/lwt- Start PHP development server from VSCode. Everything seems to work fine until making a request to
do_text.phpordo_test.php - Read a text, which results in a blank web page
Expected behavior
lwt automatically finds the right Mobile_Detect.php.
Screenshots
Essentially blank web page:

Desktop (please complete the following information):
- OS: MacOS 12.0.1
- Browser: Safari
- PHP 7.4.12
- MySQL 5.7.32
Additional context
Specifying the absolute path to Mobile_Detect.php fixes the issue, but I'm sure this isn't the most elegant solution.
require_once '/Users/username/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php'; // (was 'vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php';)
Since composer installs both mobiledetect/mobiledetectlib and hugofara/lwt in vendor/, this also works
require_once '../../mobiledetect/mobiledetectlib/Mobile_Detect.php'; // (was 'vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php';)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentation