Like me you maybe using an Ubuntu computer running Apache, MySQL and PHP to develop websites. When developing it is important to see error messages to debug your code. On occasion I have installed PHP on to Ubuntu computers and by default errors are not displayed. As this is not a production web server I updated the php.ini file to display errors. In this post I explain how I updated the php.ini to display error messages and aid debugging.
Step 1 - Open php.ini
Start by opening a new terminal window to open the php.ini file. Modifying the php.ini will allow you to tunes the setting to enable more descriptive error messages, logging, and better performance.
Enter the following command to begin editing php.ini. This will require the sudo command and therefore administrator privileges.
sudo gedit /etc/php5/apache2/php.ini
Step 2 - Display Errors
Now scroll down through the file until you find the following line.
display_errors = Off
Once you have found the display_errors line replace the parameter 'Off' with 'On'. Once you have made the swap save the file and then exit the editor.
display_errors = On
Step 3 - Restart Apache
Now that you have made the change to the php.ini file you need to restart the Apache web server to effect the change. To do this enter the command below into your terminal window to restart the service. Once the service has restarted you will be able to see error message in your PHP scripts instead of blank white pages.
sudo /etc/init.d/apache2 restart
Links
From
http://matthewwittering.com/blog/ubuntu-tips/php-error-messages.html
相关推荐
使用方法:下载后删除文件名最后的\".zip\"即可得到deb包文件。 博文链接:https://lgn21st.iteye.com/blog/207177
Ubuntu环境下,OpenCV通过链接freetype库,来支持中文显示。
Ubuntu部落:初学者推荐用书Ubuntu部落:初学者推荐用书Ubuntu部落:初学者推荐用书Ubuntu部落:初学者推荐用书
安装ubuntu时出现 unknown display错误,无法修改分辨率时的解决办法,亲试有效。
解决fatal:remote error:You can’t push to git://github.com/username/*.git问题的办法 今天Git push的时候 fatal:remote error: You can't push to git://github.com/username/*.git Use git@github....
sudo apt-get install php5 php5-common php5-cli php5-dev php5-mysql phpmyadmin php5-pgsql phppgadmin php5-gd php5-mcrypt php5-curl php-pear libapache2-mod-php5 php5-xdebug php5-codesniffer What is much...
Docker在Ubuntu16:04上的安装实例
Ubuntu部落:初学者推荐.rar
To manage your storage on Ubuntu Server systems, you will learn how to add and format storage and view disk usage. Later, you will also learn how to configure network interfaces, manage IP addresses,...
How to Do Everything Ubuntu Sep 2008 Jeffrey T. Orloff
Ubuntu 20.04基础映像 Ubuntu 20.04 Docker基础映像能够测试剧本和Ansible角色,就像使用systemd的操作系统一样。标签latest :最新的稳定版本。 XYZ :与标签XYZ相关的确切版本develop :当前正在测试的版本。 main...
为了在Ubuntu系统上为Qt配置ROS开发环境,我参考了好多博客,走了不少弯路。为此,将最终办法总结于此,供大家参考
学习Linux下Ubuntu版本的不可多得的入门资料 好好利用 完全免费
安装Ubuntu
现在ubuntu上,默认是不支持chkconfig命令的,但支持自己安装,需要自己去下载对应的安装包。 方法:在存放该文件的目录下执行:dpkg -i chkconfig_11.0-79.1-1ubuntu1_all.deb
Ubuntu安装redis和redis-php扩展, Ubuntu安装redis和redis-php扩展 Ubuntu安装redis和redis-php扩展