PDA

View Full Version : Directadmin doesn't run PHP code in skins on FreeBSD



zEitEr
07-26-2010, 04:00 AM
Hello!

OS: FreeBSD 7.2-RELEASE amd64
DirectAdmin v1.36.0

Directadmin does not run any PHP code added to skins.
I've installed plugin for DirectAdmin, but no link for Admin/Reseller/User is shown.

Plugin works fine, if accessed directly. The same is with "Hello, World" plugin (http://www.directadmin.com/hello_world.tar.gz). No links.

I've checked skins (default and customized). Just the same, no links. No PHP is executed in the section:


|$/usr/local/bin/php
<?php
$data = <<<END
|PLUGIN_0_ADMIN_TXT|
END;
if (strlen($data) > 1)
{
echo <<<END
<tr>
<td class=list>
$data
</td>
<td class=list>
|PLUGIN_1_ADMIN_TXT|
</td>
</tr>
END;
}
...
...
...


of the /usr/local/directadmin/data/skins/power_user/admin/content_main.html

I've added:


{== |$/usr/local/bin/php
<?php
print "Hello!";
?>
DONE| ==}

into /usr/local/directadmin/data/skins/power_user/header.html
...and nothing but {== ==}.

Have no other servers with FreeBSD 64 to check it out. But there's no such a problem on CentOS (fresh DA) boxes and FreeBSD 7.2-RELEASE i386 (DA v1.34.5).

How can I fix it?

zEitEr
07-26-2010, 04:14 AM
Found v1.35.1 in my backups, just the same for that FreeBSD box.

DirectAdmin Support
07-26-2010, 12:36 PM
Hello,

Can you paste the output from
ls -la /usr/local/bin/phpAlso, try it manually, eg, run:
/usr/local/bin/phpand type in:
<? echo "hi\n"; ?>press ctrl-d to execute this. (ctrl-d may need to be typed twice)

Beyond that, check DA in debug mode:
http://help.directadmin.com/item.php?id=293

to see if there is any relevant info from the output.

John

zEitEr
07-26-2010, 05:39 PM
Hi,

Thanks John for your help. Debug mode really helped to find the way out.
It's somehow the problem of Zend. PHP code work fine with zend switched off:


[Zend]
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0
;zend_optimizer.version=3.3.0a
;
;zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
;zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

PGP
09-16-2011, 02:16 AM
Have the same problem... After PHP updating to 5.3.6.
Already 2 days trying to solve it.
Here is my situation.
OS: FreeBSD 7.1 amd64.
PHP 5.3.6 builded from ports.
Here is info about php:

# php -v
PHP 5.3.6 with Suhosin-Patch (cli) (built: Aug 2 2011 18:15:31)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with NuSphere PhpExpress v3.0.0, Copyright (c) 2002-2010 NuSphere Corp., by Dmitri Dmitrienko
with XCache v1.3.2, Copyright (c) 2005-2011, by mOo
Here is screenshot how it looks (http://img705.imageshack.us/img705/6348/directadminv1391.jpg). Looks like code doesnt parsed by PHP, and just encoded in strange way... :(

When i try to execute from cl /usr/local/bin/php, then type simple php code and then press CTRL+D (twice) - nothing is displayed.
But if I disable any INI files and execute php in such way:

/usr/local/bin/php -n
I can input and execute multiline code by pressing CTRL+D.
But i can not use such method in skin :( It doenst work.

|$/usr/local/bin/php -n
<?php
echo "Test";
?>
DONE|


So, i tried to make a simple bash script and use it in skin, but there is no any results displayed.
For example, in skin:

|$/usr/local/bin/php_n
<?php
echo "Test";
?>
DONE|

In file /usr/local/bin/php_n

/usr/local/bin/php -n

BTW, in this way i also can execute PHP code from command line.
If i create such sh script with following content - its works fine:

#!/usr/local/bin/php -n
<?php
echo "Hello";
?>

PGP
09-19-2011, 01:53 AM
Problem solved. ;)
The same issue http://www.directadmin.com/forum/showthread.php?p=200387.
In my case I reinstall PHP (update to 5.3.8) without ZEND Multibyte Support. And all Extensions.