When I try to run the command ScriptAlias, I always get the error:
ScriptAlias: command not found
I have made sure that the alias mod is enabled through a2enmod alias, and I have ran apt-get update a few times as well. Does anyone know what could be causing this?
I realized that I did not understand how the module worked, and was trying to use the command directly into the command line. I needed to edit the 000-default.conf file instead.
I'm on OS X 10.9 (though, it was the same in 10.8)
I'm trying to get display_errors set to On but can't figure it out. I didn't have a php.ini file in /etc so I copied /etc/php.ini.default cp /etc/php.ini.default /etc/php.ini.
I then went into /etc/php.ini and uncommented the line display_errors and set it to On - display_errors=On. Saved the file and went to phpinfo().
For "Configuration File (php.ini)" Path it shows "/etc" and for "Loaded Configuration File" it shows "/etc/php.ini" so I assume that means it's using the correct php.ini file right?
But, when I scroll down in phpinfo() it shows "display_errors" as Off for both Local Value and Master Value.
What am I doing wrong? Is there another place I need to turn display_errors On? I'm using PHP 5.4.17
Edit: Forgot to mention that I've restarted apache several times with sudo apachectl restart and still no change.
Also, I found it weird that before I copied php.ini.default to /etc/php.ini, php was presumably using some default php.ini file but display_errors was still set to Off. Isn't that On by default?
h2ooooooo got it figured out. I uncommented the wrong section to set it to On. It was turing back off later down the page. All good now.
I have just installed Ubuntu & starting with LAMP.
I installed it & it was working just fine till I installed uTorrent. Then after localhost was not opening & I tried with stopping apache & again restarting with it.
I used - sudo service apache2 restart
Now this error is coming - Could not open configuration file /etc/apache2/apache2.conf: No such file or directory
I checked there, there is no such file with this name.
Installed uTorrent is running on 8080 port...can it be problem ?
I really don't know what to do.
Is there an /etc/apache2/httpd.conf ?
If there is, have a look inside it and see what is being included i.e look for anything along the lines of:
Include /etc/apache2/apache2.conf
Basically there error is being thrown because of an incorrect pathname in a Include directive in a conf file
I'm using Ubuntu Natty. I recently installed NGINX 1.0.6 and PHP 5.3.8 (with --enable-fpm) from source. Everything went ok and I tested it with an info.php page with phpinfo().
I then installed APC and Memcache using PECL i.e. pecl install apc, etc. That seemed to go ok as well.
However, when I edit my php.ini file and add the extension_dir and extension modules for both APC and Memcache, I get the following when I restart PHP.
Starting php-fpm PHP Warning: Module 'apc' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'apc' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning: Module 'memcache' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'memcache' already loaded in <b>Unknown</b> on line <b>0</b><br />
done
When I open the info.php file to check what loaded, everything seems ok i.e. I see APC and Memcache references in the information.
But when I uncomment the extensions i.e. ;extension=apc.so and ;extension=memcache.so, there are no errors, but the APC and Memcache listings in PHPinfo no longer appear.
I'm not sure how these extensions are being loaded twice and from where. I'd appreciate some guidance.
Thanks in advance.
EDIT
I'm using PHP-FPM and using lsof -i -P it appears that I have multiple pools of PHP-FPM running. Could this be part of the problem why I am seeing this error?! Is there a way to fix this?!
When you run: php --ini, do you get this:
Configuration File (php.ini) Path: /etc/php5
Loaded Configuration File: /etc/php5/php.ini
Scan for additional .ini files in: /etc/php5
Additional .ini files parsed: /etc/php5/php.ini
If yes, you should re-run your configure script so not to specify the additional ini file directory.
This question already has answers here:
How can I get useful error messages in PHP?
(41 answers)
Closed 5 years ago.
This has never happened before. Usually it displays the error, but now it just gives me a 500 internal server error. Of course before, when it displayed the error, it was different servers. Now I'm on a new server (I have full root, so if I need to configure it somewhere in the php.ini, I can.) Or perhaps its something with Apache?
I've been putting up with it by just transferring the file to my other server and running it there to find the error, but that's become too tedious. Is there a way to fix this?
Check the error_reporting, display_errors and display_startup_errors settings in your php.ini file. They should be set to E_ALL and "On" respectively (though you should not use display_errors on a production server, so disable this and use log_errors instead if/when you deploy it). You can also change these settings (except display_startup_errors) at the very beginning of your script to set them at runtime (though you may not catch all errors this way):
error_reporting(E_ALL);
ini_set('display_errors', 'On');
After that, restart server.
Use php -l <filename> (that's an 'L') from the command line to output the syntax error that could be causing PHP to throw the status 500 error. It'll output something like:
PHP Parse error: syntax error, unexpected '}' in <filename> on line 18
It's worth noting that if your error is due to .htaccess, for example a missing rewrite_module, you'll still see the 500 internal server error.
Be careful to check if
display_errors
or
error_reporting
is active (not a comment) somewhere else in the ini file.
My development server refused to display errors after upgrade to
Kubuntu 16.04 - I had checked php.ini numerous times ... turned out that there was a diplay_errors = off; about 100 lines below my
display_errors = on;
So remember the last one counts!
Try not to go
MAMP > conf > [your PHP version] > php.ini
but
MAMP > bin > php > [your PHP version] > conf > php.ini
and change it there, it worked for me...
Enabling error displaying from PHP code doesn't work out for me. In my case, using NGINX and PHP-FMP, I track the log file using grep. For instance, I know the file name mycode.php causes the error 500, but don't know which line. From the console, I use this:
/var/log/php-fpm# cat www-error.log | grep mycode.php
And I have the output:
[04-Apr-2016 06:58:27] PHP Parse error: syntax error, unexpected ';' in /var/www/html/system/mycode.php on line 1458
This helps me find the line where I have the typo.
If all else fails try moving (i.e. in bash) all files and directories "away" and adding them back one by one.
I just found out that way that my .htaccess file was referencing a non-existant .htpasswd file. (#silly)