PHP: params must be mixed - php

It seems the whole world community has never encountered this php error before, judging from google results:
I am trying to set up the Typo3 CMS and I get this error
Type of TYPO3\CMS\Core\IO\CsvStreamFilter::$params must be mixed (as in class php_user_filter) in C:\xampp\htdocs\typo3test\example-project-directory\public\typo3\sysext\core\Classes\IO\CsvStreamFilter.php on line 26
Line 26 in that file looks as follows:
class CsvStreamFilter extends \php_user_filter
I am rather new to PHP, how do I fix this error?
What I have tried so far:
changingdeclare(strict_types=1) in that file to declare(strict_types=0) but it just gets overwritten again
Help!

The instructions in the typo3 guide are slightly outdated.
So in composer create-project typo3/cms-base-distribution:^11 example-project-directory just replace 11 with 11.5.1 or whatever is the lastest version.

Related

phpseclib error bigInterger not found on line x

hi this my error when i want implement RSA algorithm in PHP how to fix this problem everything seems okay and i not changing anything
Fatal error: Class 'phpseclib\Math\BigInteger' not found in
phpseclib/Crypt/RSA.php on line 509 this is line 509 in __construct
method of RSA class $this->zero = new BigInteger(0);
how to fix this problem
My guess: you're trying to use either the 2.0 version (or the master branch in github) of phpseclib and aren't using an autoloader (eg. Composer), as is required by those versions.
If you don't want to use an autoloader then you'll need to use the 1.0 branch.
use below code as header
Phpseclib\Math\BigInteger
istead of
phpseclib\Math\BigInteger
name start with Capital later in update versions. It resolved my issue

Error when trying to convert html to pdf using DomPDF

I'm using the Barryvdh/laravel-dompdf which is a laravel 5 wrapper for the domPDF library (Link to GIT). But after I ran a composer update on my project, I get a error message when I try to convert a html file to a pdf file. The error is as follow FatalErrorException in class.pdf.php line 1876: Call to undefined method Cpdf::o_rapport(). I couldn't find a solution for the specific problem so I tried to downgrade the version of the Barryvdh/laravel-dompdfand run composer again, but that didn't help. So after that I looked at the stacktrace and tried finding the piece of code that fires the FatalError, but nowhere in the code the method o_rapport() is being called, even if I use the search function of my IDE to search my complete project for this method, no reference are found so that is a dead end aswell.
Now I want to ask if someone did encounter the same problem as me and how to fix this.

Fatal error: Call to undefined function httppost()

I am trying to make a project work. But I am getting an error like this:
Class 'App' not found in /var/www/html/project/test.php on line 4
line 4 of this file says:
app::$activepage = $_GET['_page'] ? httpget('_page') : $_POST['_page'] ? httppost('_page') : 0);
I am using cakePhp Version: 1.3.15-1.
The weird thing is that when I do apt show cakephp it says State: not installed
However, I have followed all the instructions of https://www.digitalocean.com/community/tutorials/how-to-install-cakephp-on-an-ubuntu-12-04-vps and when I open the index.php file of cakephp, it doesn't indicate any errors.
As I said in my Comment:
Your snippet / folder structure doesn't look like CakePHP.
Part of the problem may be a version mismatch. You say you're using version 1.3.15, but the tutorial on installing it that you link was created over a year later and references version 2.3.9. It looks like the general steps are the same, based on comparing your tutorial to the steps in the 2.X blog tutorial. You might have more luck with an older tutorial on using CakePHP on Ubuntu. Most of the steps look similar, but there are some differences with the .htaccess portion that could be causing the problem. Neither the 1.3 or 2.3 versions look like they require any "installing."
If you're not looking at the older version for any particular reason, of course it's best to use the most recent version of CakePHP, but I assume you have a particular reason for using that version. But if you're stuck, you might try a newer version to see if it gives the same errors.

Codeigniter Command line error - PHP Fatal error: Class 'CI_Controller' not found

After following the user guide instructions found here: http://ellislab.com/codeigniter/user-guide/general/cli.html I'm unable to run the test script via command line.
My controller located at /var/www/mysite/application/controllers/
class Tools extends CI_Controller {
public function message($to = 'World')
{
echo "Hello {$to}!".PHP_EOL;
}
}
In my browser I can access
http://mysite/tools/message/ben
And the function correctly outputs "Hello ben"
From terminal I should be able to run:
$ php index.php tools message "Ben"
My terminal should print: "Hello Ben"
However I get the following error:
PHP Fatal error: Class 'CI_Controller' not found in /var/www/mysite/system/core/CodeIgniter.php on line 233
My server is pretty standard; ubuntu LAMP. Codeigniter is pretty standard too and I have no problem running non CI scripts via command line
My PHP binary is only located in /usr/bin/php <-- This post suggests an issue running CI directly from usr/bin/php, however I'm not operating a shared PHP service, and I don't see why this would make a difference to how PHP executes a CI script.
Any help or just an indication on how to debug this would be greatly appreciated.
Thanks in advance.
Solved! (partly) the issue was CodeIgniters error logging.
In application/config/config.php, I modified the following config property:
$config['log_threshold'] = 0;
This disables logging, and allows $ php index.php to execute.
If anyone can explain why CI only shows this error on CLI PHP - might help anyone else who has this issue and needs it resolved with error logging on.
To solve error "Class 'CI_Controller' not found" try going to Application -> Config -> database.php then check the database details like hostname, username, password and database.
To Mijahn:
I had this same problem, and after about two hours of tracing through code to figure out the problem, it seems that there is some sort of conflict with loading the CI_Controller when utilizing the native PHP load_class function.
I worked around this issue by making the following changes to the Common.php file (hack, I know).
//$_log =& load_class('Log');
require_once('system/libraries/Log.php');
$_log = new CI_Log();
My logs then where created exactly like I wanted. Hope this hack helps.
This site says to run codeigniter from the command line, one must set the $_SERVER['PATH_INFO'] variable.
$_SERVER['PATH_INFO'] is usually supplied by php when a web request is made. However, since we are calling this script from the command line, we need to emulate this small part of the environment as a web request.
The answer provided in this Stack Overflow post worked for me.
Within system/core/CodeIgniter.php, on around line 75, change:
set_error_handler('_exception_handler');
to...
set_exception_handler('_exception_handler');
Other users have reported that this gave them a better backtrace with which to debug the underlying issue, but for me, this actually removed the problem altogether.

Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll()

I am upgrading a site from Fedora 14, PHP4, and PEAR DB to Fedora 16, PHP 5.4 and PEAR MDB2 2.5.0b3, and I am getting the error
Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll(). in /usr/share/php/MDB2.php on line 1892
Obviously, I've checked line 1892 of the MDB2.php file, and it contains the error reporting code for the __call magic method (allows you to call a specific function by passing it into __call)
I have checked for usages of __call, and there don't seem to be any. Likewise, when I try to find where MDB2_Driver_MYSQL is coming from, the only place it is even mentioned is in MDB2.php (as a comment about the driver for MySQL), in the class declaration (class MDB2_Driver_mysql extends MDB2_Driver_Common), and the description title in the .xml file.
I have manually included the /usr/share/php/MDB2/Extended.php file in the file where the MDB2_Driver_mysql class is defined, and that didn't help (not that this would have been a permanant fix...)
Has anyone encountered this error, and if so, what did you do to fix it? Google has proved nearly useless, as the only place it is specifically mentioned doesn't really deal with fixing it.
change getAll() in your class, to queryAll(), cause there some difference between DB & MDB2, and the same with getOne, getRow - they all changed to queryOne, queryRow. Here you can read about it http://www.phpied.com/db-2-mdb2/
Make sure you load the extended module in your code prior to making a query, similar to below:
$db->loadModule('Extended');

Categories