Click on images for full sized versions. XAMPP is an extremely easy to install and use Apache Server which comes bundled with MySQL (a database), PHP (server side scripting language), Perl (another server side scripting language), FileZilla FTP Server and Mercury Mail Transport System.
I have just upgraded to PHP 7.3 (using XAMPP) and for some reason it seems it is not writing errors to the specified log file.
I am getting deprecated errors on page output, but they don't seem to be showing up in any log file - which is more ideal since the errors aren't always visible in the page display, they get hidden in the code if they are generated between attribute values for example.
In my php.ini
I have:
Edit: I just noticed today the file was created recently and it had other errors in there (ones generated from issues in php.ini itself such as deprecated settings about track_errors
), but still not getting anything logged about issues caused by pages themselves.
Edit 2: I have created a separate script to generate errors on purpose and they seem t be logging fine, so I am unsure how these other ones are not logging.
Why am I not getting errors logged from pages?
2 Answers
You need to create the logsfolder on make sure your XAMPP is installed on C:
C:xamppphp
Then restart your Apache in XAMPP and try to create an fatal error by using
Please try this
Definition and Usage
The error_log() function sends an error message to a log, to a file, or to a mail account.
Syntax
error_log(message,type,destination,headers);
**> Parameter Description message Required. Specifies the error message to
log type Optional. Specifies where the error message should go.
Possible values: 0 - Default. Message is sent to PHP's system logger,
using the OS' system logging mechanism or a file, depending on what
the error_log configuration is set to in php.ini 1 - Message is sent
by email to the address in the destination parameter 2 - No longer in
use (only available in PHP 3) 3 - Message is appended to the file
specified in destination 4 - Message is sent directly to the SAPI
logging handler destination Optional. Specifies the destination of the
error message. This value depends on the value of the type parameter
headers Optional. Only used if the type parameter is set to 1.
Specifies additional headers, like From, Cc, and Bcc. Multiple headers
should be separated with a CRLF (rn) Technical Details Return
Value: TRUE on success, or FALSE on failure PHP Version: 4.0+ PHP
Changelog: PHP 5.2.7: The value of 4 was added to the type parameter**
Not the answer you're looking for? Browse other questions tagged phpphp-7error-reportingphp-7.3 or ask your own question.
Is there a way to downgrade php 5.5 to 5.3 in xampp? I searched on google but every one just tell me to uninstall xampp and install an older version. Could I have php 5.5 downgrade to 5.3 without reinstall xampp?
4 Answers
Short answer is no.
XAMPP is normally built around a specific PHP version to ensure plugins and modules are all compatible and working correctly.
If your project specifically needs PHP 5.3 - the cleanest method is simply reinstalling an older version of XAMPP with PHP 5.3 packaged into it.
XAMPP 1.7.7 was their last update before moving off PHP 5.3.
Long answer: it is possible!
- Temporarily rename existing xampp folder
- Install xampp 1.7.7 into xampp foldername
- Folder containing just installed 1.7.7 distribution rename to different name and previously existing xampp folder rename back just to xampp.
- In xampp folder rename php and apache folders to different names (I propose php_prev and apache_prev) so you can after switch back to them by renaming them back.
- Copy apache and php folders from folder with xampp1.7.7 into xampp directory
In xampp directory comment line apache/conf/httpd.conf:458
#Include 'conf/extra/httpd-perl.conf'
In xampp directory do next replaces in files:
php/pci.bat:15
![Set Handler Apache For Php 7.3 Xampp Set Handler Apache For Php 7.3 Xampp](https://www.cyberciti.biz/media/new/faq/2008/07/PHP.INI-settings-Disable-exec-shell_exec-system-popen-and-Other-Functions-To-Improve-Security.png)
from
'C:xamppphp.php.exe' -f 'xamppphppci' -- %*
to
set XAMPPPHPDIR=C:xamppphp'%XAMPPPHPDIR%php.exe' -f '%XAMPPPHPDIR%pci' -- %*
php/pciconf.bat:15
from
'C:xamppphp.php.exe' -f 'xamppphppciconf' -- %*
to
set XAMPPPHPDIR=C:xamppphp'%XAMPPPHPDIR%.php.exe' -f '%XAMPPPHPDIR%pciconf' -- %*
php/pear.bat:33
![Set Handler Apache For Php 7.3 Xampp Set Handler Apache For Php 7.3 Xampp](https://silas.com.ng/wp-content/uploads/2017/09/multiple-php-version-xampp-windows-33.jpg)
from
IF '%PHP_PEAR_PHP_BIN%'' SET 'PHP_PEAR_PHP_BIN=C:xamppphp.php.exe'
to
IF '%PHP_PEAR_PHP_BIN%'' SET 'PHP_PEAR_PHP_BIN=C:xamppphpphp.exe'
php/peardev.bat:33
from
IF '%PHP_PEAR_PHP_BIN%'' SET 'PHP_PEAR_PHP_BIN=C:xamppphp.php.exe'
to
IF '%PHP_PEAR_PHP_BIN%'' SET 'PHP_PEAR_PHP_BIN=C:xamppphpphp.exe'
php/pecl.bat:32
from
IF '%PHP_PEAR_BIN_DIR%'' SET 'PHP_PEAR_BIN_DIR=C:xamppphp'IF '%PHP_PEAR_PHP_BIN%'' SET 'PHP_PEAR_PHP_BIN=C:xamppphp.php.exe'
to
IF '%PHP_PEAR_BIN_DIR%'' SET 'PHP_PEAR_BIN_DIR=C:xamppphp'IF '%PHP_PEAR_PHP_BIN%'' SET 'PHP_PEAR_PHP_BIN=C:xamppphpphp.exe'
php/phar.phar.bat:1
from
%~dp0php.exe %~dp0pharcommand.phar %*
to
'%~dp0php.exe' '%~dp0pharcommand.phar' %*
Enjoy new XAMPP with PHP 5.3
Checked by myself in XAMPP 5.6.31, 7.0.15 & 7.1.1 with XAMPP Control Panel v3.2.2
It is possible! Yes
In many cases, you might want to use XAMPP with a different PHP version than the one that comes preinstalled.You might do this to get the benefits of a newer version of PHP, or to reproduce bugs using an earlierversion of PHP.
To use a different version of PHP with XAMPP, follow these steps:
Download a binary build of the PHP version that you wish to use from the PHP website, and extract the contents of the compressed archive file to your XAMPP installation directory (usually, C:xampp). Ensure that you give it a different directory name to avoid overwriting the existing PHP version. For example, in this tutorial, we’ll call the new directory C:xamppphp5-6-0. NOTE Ensure that the PHP build you download matches the Apache build (VC9 or VC11) in your XAMPP platform.
Within the new directory, rename the php.ini-development file to php.ini. If you prefer to use production settings, you could instead rename the php.ini-production file to php.ini.
Edit the httpd-xampp.conf file in the apacheconfextra subdirectory of your XAMPP installation directory. Within this file, search for all instances of the old PHP directory path and replace them with the path to the new PHP directory created in Step 1. In particular, be sure to change the lines
to
NOTE Remember to adjust the file and directory paths above to reflect valid paths on your system.
- Restart your Apache server through the XAMPP control panel for your changes to take effect. The new version of PHP should now be active. To verify this, browse to the URL
http://localhost/xampp/phpinfo.php
, which displays the output of the phpinfo() command, and check the version number at the top of the page.
I did this in my local environment. Wasn't difficult but obviously it was done in 'unsupported' way.
To do the downgrade you need just to download php 5.3 from http://php.net/releases/ (zip archive), than go to xampp folder and copy subfolder 'php' to e.g. php5.5 (just for backup). Than remove content of the folder php and unzip content of zip archive downloaded from php.net. The next step is to adjust configuration (php.ini) - you can refer to your backed-up version from php 5.5. After that just run xampp control utility - everything should work (at least worked in my local environment). I didn't found any problem with such installation, although I didn't tested this too intensively.