Directadmin doesn't run PHP code in skins on FreeBSD

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,449
Location
www.poralix.com
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:

Code:
|$/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:

Code:
{== |$/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?
 
Hello,

Can you paste the output from
Code:
ls -la /usr/local/bin/php
Also, try it manually, eg, run:
Code:
/usr/local/bin/php
and type in:
PHP:
<? 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
 
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:

Code:
[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
 
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. 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:
Code:
/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.
Code:
|$/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:
Code:
|$/usr/local/bin/php_n
<?php
echo "Test";
?>
DONE|
In file /usr/local/bin/php_n
Code:
/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:
Code:
#!/usr/local/bin/php -n
<?php
        echo "Hello";
?>
 
Last edited:
Back
Top