Recently, we set up a test server and visited the website to check the error log. The following errors occurred:
Fatal error: Call to undefined function json_ decode()
The reason for this problem is that the JSON extension was not installed when PHP was installed
1. First, enter the JSON directory in Ext of PHP installation package, as shown in the following figure:
2. Execute phpize, as shown in the figure below:
3. Compile configuration, as shown in the figure below:
4. Install the extension, as shown in the figure below:
5. After successful installation, you can see the json.so extension, as shown in the following figure:
6. Finally, add extension = json.so to the php.ini configuration file, as shown in the following figure:
7. Finally, restart PHP FPM to see the extension loading
Similar Posts:
- Can’t find PHP headers in /usr/include/php The php-devel package is required for use of this command.
- [Solved] PHP Fatal error: Class ‘mysqli’ not found in xxx
- Sublime Text3: How to Solve Error “There are no packages available for installation”
- Solving fastdfs in Windows Environment_ Client installation error, error: Microsoft Visual C + + 14.0 is required
- Vue Project: npm run dev :missing script:dev [How to Solve]
- Error in installing Python package — readtimeouterror
- npm ERR! missing script: dev [How to Solve]
- Cannot load php7apache2 to server
- Error modulenotfounderror when starting Django: no module named ‘pytz’