Fatal error: Cannot redeclare string_file_picture_ tex()

Fatal error: Cannot redeclare string_file_picture_ tex()

by Haller Javier Bracho -
Number of replies: 6
I get the following error when I use the TeX filter:

Fatal error: Cannot redeclare string_file_picture_tex() in /home/homelinu/public_html/haller/moodle/filter/tex/filter.php on line 50

I check the filter.php file and I think that function_exists don't work.

$textfilter_function='tex_filter';

if (function_exists($textfilter_function)) {
    return;
}

What occurs ?

Sorry for my BAD english wink
Average of ratings: -
In reply to Haller Javier Bracho

Re: Fatal error: Cannot redeclare string_file_picture_ tex()

by Zbigniew Fiedorowicz -

To test your hypothesis, copy the following code into a file test.php in your main moodle directory (same directory as your moodle config.php). Then go to the url:
http://yourmoodlesite/test.php
If you get the same error, this means that function_exists doesn't work. This would mean that there is something wrong with PHP on your web server, and you need to reinstall it.

If you don't get this error message, then there is some other problem.

<?PHP

require_once("config.php"); require("filter/tex/filter.php"); require("filter/tex/filter.php");
?>
In reply to Zbigniew Fiedorowicz

Re: Fatal error: Cannot redeclare string_file_picture_ tex()

by Haller Javier Bracho -
I get the same error sad

But I do the following:

if ( ! function_exists('tex_filter')) {
        function tex_filter() {
         .........
        }
}

I do this in ALL filter.php files (tex,algebra,censor,mediaplugins,activityname,etc)

In my system, function_exist() works, but retun() in main script file not. (i don't know why).

In reply to Zbigniew Fiedorowicz

Re: Fatal error: Cannot redeclare string_file_picture_ tex()

by Juan Emilio Fuentes -

When I activated the filters to have the autolinking with the glossary

for example, I am getting instead of glossary entry the error:

Fatal error: Cannot redeclare string_file_picture_tex() in C:\Archivos

de programa\Apache Group\Apache2\htdocs\moodle\filter\tex\filter.php on

line 50

I Have the PHP 4.3.3 and I don't have php accelerator running in my

computer. I did the test to the php software and I received the correct

answer.
When I did the test that recommended Zbigniew Feodorowicz I received

the same error.
I suppose that maybe the problem us in the php.ini or the config.php,

because I can restore the glossary entries after doing a search for

them.
Could any person say how to solve the problem. I apologize my English.
Thanks, Juan Fuentes

In reply to Juan Emilio Fuentes

Re: Fatal error: Cannot redeclare string_file_picture_ tex()

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Juan,

if you want, you can send me (privately) a copy of your php.ini and config.php files to see if something is incorrect there....

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Fatal error: Cannot redeclare string_file_picture_ tex()

by Jacob Romeyn -

I also can not turn on the filter without getting an error.

When I turn the multimedia filter on I get:

Fatal error: Cannot redeclare mediaplugin_filter() in /home/jromeyn1/public_html/moodle/filter/mediaplugin/filter.php on line 35

And the same with all of the filters.

When I install the test.php file as below I get:

Fatal error: Cannot redeclare string_file_picture_tex() in /home/jromeyn1/public_html/moodle/filter/tex/filter.php on line 50

<?PHP

require_once("config.php");
require("filter/tex/filter.php");
require("filter/tex/filter.php");

?>

How can I find out if I have a PHP accelerator?