CodeIgniter Forums
Blank Page After Installing On Mac - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Blank Page After Installing On Mac (/showthread.php?tid=88764)

Pages: 1 2


Blank Page After Installing On Mac - demyr - 11-02-2023

Hey,

First time installing on Mac and when visit my project folder I see a blank page.

If I start it with php spark serve I can see the Welcome page on http://localhost:8080/ but still no result for my project folder.

When I check errors log file I see those lines:

[authz_core:error] [pid 5443] [client 127.0.0.1:53603] AH01630: client denied by server configuration: /Applications/XAMPP/xamppfiles/htdocs/Demyr/my_project/app/
[authz_core:error] [pid 5443] [client 127.0.0.1:53603] AH01630: client denied by server configuration: /Applications/XAMPP/xamppfiles/htdocs/Demyr/my_project/writable/
[authz_core:error] [pid 5446] [client 127.0.0.1:54238] AH01630: client denied by server configuration: /Applications/XAMPP/xamppfiles/htdocs/Demyr/my_project/app/
[authz_core:error] [pid 5446] [client 127.0.0.1:54238] AH01630: client denied by server configuration: /Applications/XAMPP/xamppfiles/htdocs/Demyr/my_project/writable/
[authz_core:error] [pid 5446] [client 127.0.0.1:54238] AH01630: client denied by server configuration: /Applications/XAMPP/xamppfiles/htdocs/Demyr/my_project/system/


RE: Blank Page After Installing On Mac - captain-sensible - 11-02-2023

well what i would say in terms of serving php and html is that if you just installed CodeIgniter4 to your Desktop , change directory( using mac equivalent to linux terminal emulator) to inside of the directory and use :

Code:
php spark serve

then open a web browser and type in

Code:
http://localhost:8080

then you should see a welcome message unless writable is not "writable" . There is no need of xampp nor apache . if you use sqlite as a database you can do quite extensive web development that way.

xampp is or was a revamp of apache by "apache friends" i.e it is a web server. In that case you would not( and have no need to ) be invoking spark


The other things is ..lets have a look at etc hosts on my linux box :

Code:
[andrew@darkstar Desktop]$ cat /etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1  localhost
::1
127.0.1.1  darkstar.localdomain darkstar

127.0.0.3  joesoapdev
[andrew@darkstar Desktop]$

what the above implicitly suggests is that 127.0.0.1 is already taken . I have configured my web dev to use 127.0.0.3 and can get the landing page of my web dev by just putting 127.0.0.3 in web browser address bar. You might have conflict with xampp , so need to use set up appropriate none clashing localhost url


RE: Blank Page After Installing On Mac - demyr - 11-02-2023

OK. Then how can I install CodeIgniter on Mac and make it work without spark as I am used to? Because I don't want to work on 8080. I prefer http ://localhost/Demyr/my_project/


RE: Blank Page After Installing On Mac - captain-sensible - 11-02-2023

well thats going to take some understanding of web dev. This looks quite good:
https://www.git-tower.com/blog/apache-on-macos/

Here you use apache on mac , rather than xampp which on linux goes to /opt

if you look at my etc hosts above then http://joesoapdev will show my landing page


RE: Blank Page After Installing On Mac - kenjis - 11-02-2023

I checked XAMPP 8.2.4 on Mac, but CI4 did not work, because of no intl extension.
We need to get or compile "intl.so" for PHP 8.2.4.

Code:
$ sudo chgrp -R daemon writable/
$ chmod -R g+w writable/

Error
Class "Locale" not found search →


RE: Blank Page After Installing On Mac - InsiteFX - 11-02-2023

I use XAMPP with PHP 8.2.4 but I use VHOSTS and it all works just fine,

But @kenjis, is right even I have to un-remark the intl extension.


RE: Blank Page After Installing On Mac - demyr - 11-02-2023

(11-02-2023, 03:11 PM)kenjis Wrote: I checked XAMPP 8.2.4 on Mac, but CI4 did not work, because of no intl extension.
We need to get or compile "intl.so" for PHP 8.2.4.

Code:
$ sudo chgrp -R daemon writable/
$ chmod -R g+w writable/

Error
Class "Locale" not found search →

Yepp. Definitely it doesn't work. I even un-remarked the intl extension.in php.ini under Xampp but it didn't work. So I have mixed the suggestion of @captain-sensible : Using Xampp for mysql and php spark for the action. I didn't want to go on with sqllite.

Anyway, what is your way of setup on mac @kenjis ? What would you suggest?

@InsiteFX what virtual host are you using?


RE: Blank Page After Installing On Mac - kenjis - 11-03-2023

I use Homebrew for PHP, MySQL, and use `spark serve`.
I also installed MAMP for checking. CI4 works on MAMP, but MAMP is not updated recently. 
So PHP version is a bit old. I don't recommend it.

If you can use Homebrew, I recommend it. If you like Apache, you can install it via Homebrew.


RE: Blank Page After Installing On Mac - demyr - 11-03-2023

Thank you @kenjis ,

By the way I have another issue. I can't point my css files. Since I use php spark serve, it works on http://localhost:8080. And so my base url is http://localhost:8080. I can't use my folder name and I can't reach my css files which are under public.

How to overcome this?


RE: Blank Page After Installing On Mac - kenjis - 11-03-2023

@demyr Use base_url() like base_url('images/icons/edit.png').
See https://codeigniter4.github.io/CodeIgniter4/helpers/url_helper.html#base_url