PHP inside skin wont work

igormazej

Verified User
Joined
Nov 19, 2012
Messages
7
Hello,

I have issue with running PHP inside my skin.

Code:
|$/usr/local/bin/php
<?
echo "Hello world!";
?>
DONE|

I have php version 5.2 and ZEND Multibyte Support is not installed. OS is FreeBSD 8.2.

The interesting part is, that when I activate default theme and try the same thing, it works. What am I missing here.

thank you!
 
Hello,

thank you for your anwser.

I already tryed that. There are no errors.

This is the part that dont work (debug mode):


Code:
Command::run: finished /
executeAsUser('/usr/local/bin/php', 512, admin, 1, '<?php
$data = <<<END

END;
if (strlen($data) > 1)
{
echo <<<END
<br>
<br>
<br>
<br>

END;
}
?>
', int *child_pid, *snd, group=(null)) uid=1008 gid=1006
Sockets::handshake - begin
Sockets::handshake - end
 
In your first message you posted different example. Why? Is the example from the first message showing any error in debug mode?

This is the part that dont work (debug mode):

So, why do you think it does not work? If it's the real text passed to PHP interpreter, then you won't see anything in your browser despite the fact that PHP code was parsed OK.

What skin are you trying to use? Are you sure it's not outdated?

The code from the second post seems to be from show_domain.html. And here how it looks like in enhanced skin:

Code:
|$/usr/local/bin/php
<?php
$data = <<<END
|PLUGIN_0_TXT|
END;
if (strlen($data) > 1)
{
echo <<<END
|PLUGIN_0_TXT|<br>
|PLUGIN_1_TXT|<br>
|PLUGIN_5_TXT|<br>
|PLUGIN_7_TXT|<br>
|PLUGIN_9_TXT|
END;
}
?>
DONE|

Are you trying to add that code into a different file?
 
I'm sorry, my mistake. Tnx again for quick answer.

This is the code that Im trying to add:

Code:
|$/usr/local/bin/php
<?
echo "Hello world!";
?>
DONE|

What it happens is that when I refresh page, all I can see is this code on page, and not hello world:

Code:
|$/usr/local/bin/php DONE|

I'm modifying enhanced theme.
 
Try either

PHP:
|$/usr/local/bin/php
<?php
echo "Hello world!";
?>
DONE|

or enable

Code:
short_open_tag = On

in php.ini
 
Maybe Owner/Group and/or permissions is wrong on files in your custom skin? Make sure that Owner/Group on all folders and files are diradmin diradmin and that permissions is 755.
 
Back
Top