By didier misson on
Hello
Some problem as I move a D7.56 site to another hosting.
On all pages, excep admin page :
PHP error :
ParseError : syntax error, unexpected 'alleud' (T_STRING), expecting ',' or ')' dans php_eval() (ligne 1 dans /home/o2sw01/audrey.misson.net/public_html/modules/php/php.module(80) : eval()'d code).
('alleud' is a part of my city : Braine-l'Alleud ... but I never had problem before with this name and the ' )
On this same hosting, another D7.56 site is running well !
Why one D7.56 is ok and the other give an error ?
PHP is 7.0.26
Thanks. Have a nice WE.
Didier
Comments
Admin pages ok in HTTP, but error in HTTPS ... !
it's very strange :
ParseError : syntax error, unexpected 'alleud' (T_STRING), expecting ',' or ')' dans php_eval() (ligne 1 dans /home/o2sw01/audrey.misson.net/public_html/modules/php/php.module(80) : eval()'d code).
Of course, another site is running well with D7.56 and HTTPS
Didier
=-=
as the error is coming from the php.module, I suggest checking any php that was submitted using it.Just reread opening post. you've already found what is throwing the error so the above is no help.
please post the entirety of the line of code. Are both sites running PHP 7?
ParseError in modules/php/php.module(80) : eval()'d code)
Yes, both site use the same D 7.56.
public_html/modules/php
--------------------------------------
function php_eval($code) {
global $theme_path, $theme_info, $conf;
// Store current theme path.
$old_theme_path = $theme_path;
// Restore theme_path to the theme, as long as php_eval() executes,
// so code evaluated will not see the caller module as the current theme.
// If theme info is not initialized get the path from theme_default.
if (!isset($theme_info)) {
$theme_path = drupal_get_path('theme', $conf['theme_default']);
}
else {
$theme_path = dirname($theme_info->filename);
}
ob_start();
print eval('?>' . $code); <----------- parse error
$output = ob_get_contents();
ob_end_clean();
// Recover original theme path.
$theme_path = $old_theme_path;
return $output;
}
------------------------------
Thanks
Didier
=-=
did not need the code from the php.module. Having the php.module enabled indicates that you are using php via the php filter. Need to see the t() that's been added on your part.
PHP code
I must search ...
Long time ago I don't change this site, and I surely not enter this PHP code myself.
I find one block with PHP code
------------------
...
<li class="flickr">
<a href="http://www.flickr.com/photos/morethanthemes/">Flickr</a>
</li>
<li class="skype">
<a href="#">Skype</a>
</li>
-->
<li>
<?php $block = module_invoke('search', 'block_view', 'search'); print render($block); ?>
</li>
</ul>
--------------------
Several nodes use text format "PHP code", but empty.
Perhaps because I try to move the PHP code up in the filters order (but it doesn't solve the error).
(perhaps other... not yet check all nodes and blocks)
Thanks. Didier
PHP versions ...
Can it be a PHP code compatibility problem due to 7.0.26 ?
=-=
may explain why it's working properly on site A but not site B. I can't produce the error but I don't have the php.module enabled on any site.