Saturday, September 23, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  6] [ 0]  / answers: 1 / hits: 34957  / 4 Months ago, mon, may 29, 2023, 6:07:45

I'd like to use php includes to streamline the process of making a few web pages. The problem with that, however, is that I can't seem to test them locally. They work fine on the server, but my computer doesn't seem to understand them. I tried installing php and apache but it didn't seem to work. What do I need to do to set up a php testing server locally?

More From » php


Install the package libapache2-mod-php5 (which will also install the package for the webserver: apache2). Files can be put in /var/www.

If you then open http://localhost/index.html in your browser, /var/www/index.html is displayed.

The default settings are pretty secure, PHP errors are logged to /var/log/apache2/error_log and not showed in the browser. To change this on a development machine, edit /etc/php5/apache2/php.ini and change display_errors = Off to display_errors = On.

Some modules are not installed by default. If you do image processing, you likely need the GD library for PHP, package php5-gd. To get a list of all available modules, open a terminal, type sudo apt-get install php5- and hit Tab twice to get a list.

See also: How to avoid using sudo when working in /var/www?

[#40894] Tuesday, May 30, 2023, 4 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 162
Total Questions: 113
Total Answers: 122

Location: Zambia
Member since Sat, Oct 31, 2020
3 Years ago