CodeIgniter Forums
Installation/Startup Issue with PHP 7 built-in server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Installation/Startup Issue with PHP 7 built-in server (/showthread.php?tid=65804)



Installation/Startup Issue with PHP 7 built-in server - jasonzig - 07-26-2016

Hello All,

Thanks in advance for any input!

I git-cloned the repo to my development Mac (running Sierra/php 7) and started it using PHP7's built-in webserver like this:

Code:
➜  CodeIgniter4 git:(develop) php -S  localhost:7778 --docroot=/Users/moo/Library/Mobile\ Documents/com~apple~CloudDocs/Sites/CodeIgniter4/public
PHP 7.0.5 Development Server started at Tue Jul 26 17:38:09 2016
Listening on http://localhost:7778
Document root is /Users/moo/Library/Mobile Documents/com~apple~CloudDocs/Sites/CodeIgniter4/public
Press Ctrl-C to quit.

After accessing http://localhost:7778 in the browser, I get these errors:
Code:
[Tue Jul 26 17:38:15 2016] PHP Fatal error:  Uncaught Error: Class 'Config\App' not found in /Users/moo/Library/Mobile Documents/com~apple~CloudDocs/Sites/CodeIgniter4/public/index.php:237
Stack trace:
#0 {main}
 thrown in /Users/moo/Library/Mobile Documents/com~apple~CloudDocs/Sites/CodeIgniter4/public/index.php on line 237
[Tue Jul 26 17:38:15 2016] 127.0.0.1:51266 [500]: / - Uncaught Error: Class 'Config\App' not found in /Users/moo/Library/Mobile Documents/com~apple~CloudDocs/Sites/CodeIgniter4/public/index.php:237
Stack trace:
#0 {main}
 thrown in /Users/moo/Library/Mobile Documents/com~apple~CloudDocs/Sites/CodeIgniter4/public/index.php on line 237

Am I making a setup mistake?

Thanks,

Jason


RE: Installation/Startup Issue with PHP 7 built-in server - hanhan chen - 08-01-2016

I have the same problem.

Fatal error: Uncaught Error: Class 'Config\App' not found in /Users/HANHAN/Dropbox/玫瑰和绿叶/hd/CodeIgniter4-develop/public/index.php:237 Stack trace: #0 {main} thrown in /Users/HANHAN/Dropbox/玫瑰和绿叶/hd/CodeIgniter4-develop/public/index.php on line 237


RE: Installation/Startup Issue with PHP 7 built-in server - InsiteFX - 08-02-2016

Did you set your base_url in ./application/App.php ?


RE: Installation/Startup Issue with PHP 7 built-in server - kilishan - 08-02-2016

I wonder if it has to do with different characters in the path? Or, in the case of the first example, it's running out Mobile Documents in Library, which may have different restrictions on it. Can you try to run it in your home directory maybe? Ensure there's no spaces, foreign language symbols, etc. If that works, then we have something to start diagnosing.


RE: Installation/Startup Issue with PHP 7 built-in server - hanhan chen - 08-03-2016

(08-02-2016, 07:00 PM)kilishan Wrote: I wonder if it has to do with different characters in the path? Or, in the case of the first example, it's running out Mobile Documents in Library, which may have different restrictions on it. Can you try to run it in your home directory maybe? Ensure there's no spaces, foreign language symbols, etc. If that works, then we have something to start diagnosing.

 Thanks a lot! The problem is solved. I have placed the project in the htdocs folder in Mamp on my mac  and I solved the problem. Before I had put the project in a folder with Chinese name in Dropbox . I think the problem was the Chinese characters in the path.


RE: Installation/Startup Issue with PHP 7 built-in server - kilishan - 08-03-2016

Glad that got it working for you!


RE: Installation/Startup Issue with PHP 7 built-in server - Muzikant - 12-12-2019

It should be mentioned in the documentation, that your path can not have local characters in it. I struggled a while when I was trying to run CI4 on my localhost. I have a link to another location in my XAMPP's htdocs directory, which leading to a path with special characters in it. CI3 works fine. What is causing the problem in CI4? I do not have local characters in URL, only on real path on the disk.


RE: Installation/Startup Issue with PHP 7 built-in server - InsiteFX - 12-12-2019

No but you did have spaces which are replaced by the browser with %20


RE: Installation/Startup Issue with PHP 7 built-in server - Muzikant - 12-12-2019

(12-12-2019, 08:45 AM)InsiteFX Wrote: No but you did have spaces which are replaced by the browser with %20

Thank you for your answer. I am not using spaces. I think, the browser has nothing to do with it. The problem could be in translating special characters like á/é/í/ó/ú in URL helper.

The real path is "/home/user/Skúška/ci4/public/", the URL is "http://localhost/test/ci4/public/".

Code:
Fatal error: Uncaught Error: Class 'CodeIgniter\Autoloader\FileLocator' not found in /home/user/Skúška/ci4/system/Config/BaseService.php:168 Stack trace: #0 /home/user/Skúška/ci4/system/Common.php(593): CodeIgniter\Config\BaseService::locator(true) #1 /home/user/Skúška/ci4/system/bootstrap.php(154): helper('url') #2 /home/user/Skúška/ci4/public/index.php(36): require('/home/user/Sk\xC3\xBA...') #3 {main} thrown in /home/user/Skúška/ci4/system/Config/BaseService.php on line 168

Look at this part: "require('/home/user/Sk\xC3\xBA...')". Again, there is no problem with CI3.