Whoops! We seem to have hit a snag. Please try again later

By | January 8, 2024

After installing CodeIgniter 4 when you run the app then you will get an error like this:

Whoops! We seem to have hit a snag. Please try again later

And in cmd line when run composer update you see something similar to this output below:
Problem 1
– codeigniter4/framework[4.0.0, …, v4.4.4] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
– Root composer.json requires codeigniter4/framework ^4.0 -> satisfiable by codeigniter4/framework[4.0.0, …, v4.4.4].

To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/8.2/cli/php.ini
– /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
– /etc/php/8.2/cli/conf.d/10-opcache.ini
– /etc/php/8.2/cli/conf.d/10-pdo.ini
– /etc/php/8.2/cli/conf.d/15-xml.ini
– /etc/php/8.2/cli/conf.d/20-calendar.ini
– /etc/php/8.2/cli/conf.d/20-ctype.ini
– /etc/php/8.2/cli/conf.d/20-curl.ini
– /etc/php/8.2/cli/conf.d/20-dom.ini
– /etc/php/8.2/cli/conf.d/20-exif.ini
– /etc/php/8.2/cli/conf.d/20-ffi.ini
– /etc/php/8.2/cli/conf.d/20-fileinfo.ini
– /etc/php/8.2/cli/conf.d/20-ftp.ini
– /etc/php/8.2/cli/conf.d/20-gd.ini
– /etc/php/8.2/cli/conf.d/20-gettext.ini
– /etc/php/8.2/cli/conf.d/20-iconv.ini
– /etc/php/8.2/cli/conf.d/20-mbstring.ini
– /etc/php/8.2/cli/conf.d/20-mysqli.ini
– /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
– /etc/php/8.2/cli/conf.d/20-phar.ini
– /etc/php/8.2/cli/conf.d/20-posix.ini
– /etc/php/8.2/cli/conf.d/20-readline.ini
– /etc/php/8.2/cli/conf.d/20-shmop.ini
– /etc/php/8.2/cli/conf.d/20-simplexml.ini
– /etc/php/8.2/cli/conf.d/20-sockets.ini
– /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
– /etc/php/8.2/cli/conf.d/20-sysvsem.ini
– /etc/php/8.2/cli/conf.d/20-sysvshm.ini
– /etc/php/8.2/cli/conf.d/20-tokenizer.ini
– /etc/php/8.2/cli/conf.d/20-xmlreader.ini
– /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
– /etc/php/8.2/cli/conf.d/20-xsl.ini
You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.

The solution: This method works better and doesn’t have the message above.

root@en-03:# sudo apt-get install php8.2-mcrypt php8.2-intl php8.2-curl php8.2-xsl php8.2-mbstring php8.2-xsl php8.2-zip php8.2-soap php8.2-gd

root@en-03:# sudo service nginx restart
root@en-03:# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful