I'm getting the error when trying to access any page running on the builtin php webserver (including just a phpinfo):
Fatal error: Could not delete queued timer in Unknown on line 0
This is the command I am using to run the server
~/php-win$ wine php.exe -S localhost:8080
Here is the content of my php.ini file, which I am assuming is the cause of the error because of the Unknown on line 0 part.
Through trial and error I have discovered that if I comment out the max_input_time value then pages will load fine however the error shows up at the bottom of the page instead. See the below image:
I also had the exact same issue when attempting to set up an EasyPHP server as well (through wine also).
The only other question I could find on this error was this question, however this is happening when I run any file through the built-in webserver, including a blank file.
Also, I am using PHP 7.1.3
Edit your php.ini and put the location of extension folder , the folder named ext inside your php folder
php.ini
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "/media/viney/01D58852BCA3B9C0/UwAmp/bin/php/php-7.0.3/ext"
Then I enable a few extensions in php.ini
php.ini
extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
extension=php_tidy.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
Now if I run php, extenions get loaded
viney#Notebook:/media/viney/01D58852BCA3B9C0/UwAmp/bin/php/php-7.0.3$ wine php -S localhost:8080
PHP 7.0.3 Development Server started at Mon May 4 09:28:07 2020
Listening on http://localhost:8080
Document root is Z:\media\viney\01D58852BCA3B9C0\UwAmp\bin\php\php-7.0.3
Press Ctrl-C to quit.
What the question is about: need each script to log its errors in the same directory that the script is located, need to achieve this through pure configuration. By script I am not referring to included files, I'm referring to the files of the executing web pages.
Example 1
A syntax error of:
/var/www/html/index.php
Has to log to:
/var/www/html/error.log
Example 2
A syntax error of:
/var/www/html/foobar/page.php
Has to log to:
/var/www/html/foobar/error.log
I did some configuration attempting to achieve the solution, but it doesn't work, the log file isn't being created (at least not in the directory of the script).
I used phpinfo() to check the location of php.ini, it's /etc/php.ini. In this file I configured:
log_errors = On
error_log = error.log
Then I just restarted the whole system with /sbin/shutdown -h now (restarted the computer), then I checked phpinfo() and confirmed that the changes are made.
What I researched is that when the value of the error_log directive isn't an absolute path, but instead only a file name, then the location of the log file will be the same directory of the script which generates the error, and will have that file name.
So, if the log file doesn't exist in the script's location, then it should be created there when an error occurs, but for some reason it's not being created. To see if it's a permission problem I manually created the log file and gave it full permissions (rwxrwxrwx), but still nothing is logged into this file when I reproduced the error. Finally I also tryed full permissions (rwxrwxrwx) for the directory containing the log file, but the problem persists.
So what's the cause and solution?
System information: GNU/Linux CentOS with Apache.
Note: This is not a duplicate of error_log in the same directory as included files?, this question has nothing to do with included files.
Note 2: This is not a duplicate of PHP Parse/Syntax Errors; and How to solve them?, the syntax error is obviously just a random example, the question is not about solving syntax errors.
Remove the whole path from error_log directive except the file name.
error_log = var/www/html/error.log
to
error_log = error.log
The cause of the problem was SELinux restricting Apache from reading or writing in the files or directories.
Solutions
If the error log file already exists: in this case an alternative is to change the SELinux context of the file to the type httpd_sys_rw_content_t (instead of httpd_sys_content_t or other):
chcon -t httpd_sys_rw_content_t /var/www/html/error.log
If the error log file doesn't exist and has to be created by Apache: in this case an alternative is to change the SELinux context of the directory:
chcon -t httpd_sys_rw_content_t /var/www/html
Source: https://wiki.centos.org/HowTos/SELinux
On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying)
PHP Warning: Module 'intl' already loaded in Unknown on line 0
I ran
php --ini
and the output was
php --ini
PHP Warning: Module 'intl' already loaded in Unknown on line 0
Warning: Module 'intl' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File: /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed: /usr/local/etc/php/5.5/conf.d/ext-apcu.ini,
/usr/local/etc/php/5.5/conf.d/ext-igbinary.ini,
/usr/local/etc/php/5.5/conf.d/ext-intl.ini,
/usr/local/etc/php/5.5/conf.d/ext-memcached.ini,
/usr/local/etc/php/5.5/conf.d/ext-mongo.ini,
/usr/local/etc/php/5.5/conf.d/ext-uuid.ini,
/usr/local/etc/php/5.5/conf.d/ext-xdebug.ini
Checked in the php.ini file and the only place intl is loaded is at the top and it's commented out. The other files contents look something like:
extension="/usr/local/Cellar/php55/5.5.23/lib/php/extensions/no-debug-non-zts-20121212/intl.so"
where the contents after the last slash is the extension.
I'm not sure where else to look.
Any help is appreciated
I think you have loaded Xdebug probably twice in php.ini.
check the php.ini, that not have set xdebug.so for the values extension= and zend_extension=.
Check also /etc/php5/apache2 and /etc/php5/cli/. You should not load in each php.ini in these directories the extension xdebug.so. Only one file, php.ini should load it.
Note: Inside the path is the string /etc/php5. The 5 is the version of PHP. So if you use another version, you always get a different path, like php7.
I had the same issue on mac i.e. Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0.
Here's how I solved it.
Locate the folder conf.d, mine was in the directory
/usr/local/etc/php/7.0/conf.d.
In this folder, there's a file called ext-pdo_pgsql.ini.
Type sudo nano ext-pdo_pgsql.ini to edit it.
There should be a line extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so". Comment it
out by adding semi-colon to the beginning of the line i.e.
;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so".
Save the file. (I usually run control + O, control + M).
Exit the file (control + X).
Hope this helps someone.
To fix this problem, you must edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in. For example, after editing, your ini file may look like the lines below:
;extension=pcre.so
;extension=spl.so
Source: http://www.somacon.com/p520.php
You should have a /etc/php2/conf.d directory (At least on Ubuntu I do) containing a bunch of .ini files which all get loaded when php runs. These files can contain duplicate settings that conflict with settings in php.ini. In my PHP installation I notice a file conf.d/20-intl.ini with an extension=intl.so setting. I bet that's your conflict.
In my case I had uncoment the ;extension=php_curl.so in php.ini, but Ubuntu was already calling this extension somewhere else.
To find this "somewhere else", on php.ini will informe. On my case:
/etc/php/7.1/apache2/conf.d/20-curl.ini was the path.
So now we edit this file (terminal):
sudo nano /etc/php/7.1/apache2/conf.d/20-curl.ini
Comment the ;extension=php_curl.so
Save file and restart apache:
sudo systemctl restart apache2
solved by commenting extension=curl
For issue related to code igniter project upload,
go to the base directory index.php and add this code:
if ($_SERVER['SERVER_NAME'] == 'local_server_name') {
define('ENVIRONMENT', 'development');
} else {
define('ENVIRONMENT', 'production');
}
if (defined('ENVIRONMENT')){
switch (ENVIRONMENT){
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
For shared hosting, in cPanel I unchecked the Module in question under "Select PHP Version" > "Extensions" and the error disappeared for PHP 7.4.
I had the same issue after upgrading from Fedora Server 24 (PHP 5) to 25 (PHP 7). After investigation, I found that /etc/php.d/ had two different .ini files loading extension=geoip.so.
Previous version of distros had this file named 50-geoip.ini but the recent was changed to 40-geoip.ini, and I suspect that in the version-upgrade process the old hasn't been removed, while the new one has been created.
That was the actual case of the issue. After removing stray 50-geoip.ini from /etc/php.d/ and restarting httpd it just worked flawlessly.
I deleted the 20-mongo.ini file in /etc/php5/cli/conf.d and this solved the problem.
I figured this out by printing the PHP configuration and searching by xml.ini. Notice in the following output how xml is loaded twice (first as 20-xml.ini and then as xml.ini):
$ php -i | grep xml
/etc/php.d/20-simplexml.ini,
/etc/php.d/20-xml.ini,
/etc/php.d/20-xmlwriter.ini,
/etc/php.d/30-xmlreader.ini,
/etc/php.d/xml.ini
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
libxml Version => 2.9.1
libxml
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text /|application/xhtml\+xml)
xml
libxml2 Version => 2.9.1
xmlreader
xmlwriter
libxslt compiled against libxml Version => 2.9.1
There are two "php_intl.dll" files inside php.ini file on 872 and 968 number lines. if php warning module 'intl' already loaded in unknown on line 0 this message is focused on your CLI. Then you should have to remove the semiclone prefixes on line 872. I expect this will done.....
Just for the record as it might help others who are on shared hosting (cPanel).
I had error on shared hosting php7.2:
Module 'imagick' already loaded in Unknown on line 0
In the beginning hosting provider said it was my bad configuration (running Yii2.16). But after I showed them, that all Internet related this issue to server configuration -they started to listen to me. After I proved, that there was no error on php7.1 they started to search for the error.
As they told to me - the error was due to configuration in PERL modules or PEAR package, but they did not told me the real issue.
So, if you are on shared hosting - talk to you provider and experiment with PHP versions (if you can change them).
Comment out these two lines in php.ini
;extension=imagick.so
;extension="ixed.5.6.lin"
it should fix the issue.
In Windows 10, I fix this by comment like this
;extension=php_sockets.dll
Run php --ini and notice file path on Loaded Configuration File.
Then run command like cat -n /etc/php/7.2/cli/php.ini | grep intl to find if the extension is commented or not.
Then update loaded configuration file by commenting line by adding ; such as ;extension=intl
This can happen when you install php-intl package and also enable the same extension on php.ini file.
If you are on shared hosting, just apply the default php settings. Cpanel overrides php settings to default.
I am using WAMP in Windows 10 with PHP 7.2.10. I was able to solve it through commenting the line extension=ftp in php.ini inside wamp64\bin\php\php7.2.10 .
I am unsure but my guess why this happens is that my php.ini inside wamp64\bin\apache\apache2.4.35\bin already loads this module.
Be sure to restart all services of WAMP after doing so.
I had the same issue so I commented the extension=mysqli as I included this to run sql server. Check if you have uncommented this extension=mysqli if so, place ; in php.ini
I resolved this issue by removing php.ini file from extension=grpc commenting like this ;extension=grpc
I had a similar problem, the problem was that the extension intl was duplicated.
You can check in file C:/xampp/php/php.ini and find "intl". In my case extension=intl is already present and I scrolled again and found a second intl "extension=php_intl.dll".
The extension must one to execution can't execution extension intl again. This will show error like this "Module 'intl' already loaded".
I fixed it by commenting out extension=php_intl.dll using ";" like this ;extension=php_intl.dll. and restarted the apache service.
I am working on ubuntu 12.04. I installed HTTP_Client by sudo pear install HTTP_Client. But when I am using require_once 'HTTP/Client.php';. It's showing:
Warning: require_once(HTTP/Client.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/mai.php on line 3
How I remove this error?
How paths are resolved when using include or require is controlled by the include_path php.ini setting, which is typically set to:
include_path=".:/usr/share/php"
Whereby /usr/share/php points to where PEAR is installed.
It can be set using set_include_path() during runtime as well:
set_include_path(".:/usr/share/php");
Should be run before you include anything else.
'HTTP/Client.php' is a relative path. The error message means that the file doesn't exist at that location. You'll need to modify the path, or move the file.
In this case your PHP file is in "/var/www/" and there is no HTTP directory there.
Edit: I would recommend modifying the path to be the full path rather than the relative path:
require_once 'HTTP/Client.php';
Change to:
require_once '/usr/share/php/HTTP/Client.php';
I've updated php.ini and moved php_mysql.dll as explained in steps 6 and 8 here.
I get this error…
Fatal error: Call to undefined function mysql_connect() in C:\inetpub...
MySQL doesn't show up in my phpinfo; report.
I've updated the c:\Windows\php.ini file from
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
to
; Directory in which the loadable extensions (modules) reside.
extension_dir = ".;c:\Windows\System32"
Result: no change.
I changed the php.ini value of extension_dir thusly:
extension_dir = "C:\Windows\System32"
Result: much more in the phpinfo; report, but MySQL still isn't working.
I copied the file libmysql.dll from folder C:\php to folders C:\Windows\System32 and C:\Windows
Result: no change.
I stopped and restarted IIS.
Result: new, different errors instead!
Warning: mysql_connect() [function.mysql-connect]: Access denied for
user '...'#'localhost' (using password: YES) in C:\inetpub\...
error in query.
Fatal error: Call to a member function RecordCount() on a non-object
in C:\inetpub\...
I found several .php files in the website where I had to set variables:
$db_user
$db_pass
Result: The site works!
As the others say these two values in php.ini are crucial.
I have the following in my php.ini: note the trailing slash - not sure if it is needed - but it does work.
extension_dir = "H:\apps\php\ext\"
extension=php_mysql.dll
Also it is worth ensuring that you only have one copy of php.ini on your machine - I've had problems with this where I've been editting a php.ini file which php isn't using and getting very frustrated until I realised.
Also if php is running as a module within apache you will need to restart the apache server to pickup the changes. Wise to do this in anycase if you're not sure.
a "php -m" from the cmd prompt will show you the modules that are loaded from the ini file.
In the php.ini file, check if the extention path configuration is valid.
You will need to enable the extension=php_mysql.dll option in the php.ini as well. Also, make sure that the file is in the extension_dir you set.
You can read more about it at:
http://us3.php.net/manual/en/install.windows.extensions.php
On a completely different note, might I suggest WampServer? It should get you up and running with a Apache/PHP/MySQL install in no time.
You could even compare the WampServer config files with your own to see where you originally went wrong.