Can't get any of the PHP commands to work.

Permalink
I'm not sure if its because I'm using WAMP on a local server, or if I may have installed Concrete5 wrong. All I know is that when I build my own theme it will not read any of the php and it just displays the php in the source code.

I've always used XAMPP but couldn't get it to work with this so I switched to WAMP so maybe I have a setting turned off?

 
programmieraffe replied on at Permalink Reply
programmieraffe
Which php tags do you use? "<?php" or "<?" ? I think I heard that in recent versions of PHP there will be no support anymore for "<?". At least I think I heard, so please correct me if I'm wrong. ;)
Sicon replied on at Permalink Reply
I've tried both to no avail.
clmedia replied on at Permalink Reply
clmedia
The easiest way to diagnose whether it's a c5 problem or WAMP is to create your own simple php file like:

<?php
echo "Hello world";
?>


If that doesn't work, then WAMP is not interpreting the PHP. My guess is that it may be a problem with the WAMP setup (i.e. php files not in the right directory, "servers" not running, etc.)
Sicon replied on at Permalink Reply
That's that first thing I did before I made this. It works fine.

The code that shows in the source is
<?=$this->getThemePath()?>
. The
<?php $a = new Area('Main Content 2');$a->display($c);?>
shows nothing, no php, no html. And the header leaves a gap at the top
clmedia replied on at Permalink Reply
clmedia
Have you enabled short tags in the php.ini file? A quick Google search or search on the WAMP forums can show you how. Give that a whirl (then restart apache after you make the change).
Sicon replied on at Permalink Reply
Yes I have, and I've even tried to using <?php and it still does the same thing.
clmedia replied on at Permalink Reply
clmedia
Does concrete5 work fine with the pre-installed themes on your WAMP setup? If it's just messing up when you install your own theme, then it's probably something going wrong with the way you're building the theme. Without seeing your site / code / theme it's hard to know.

Forgive me if you've already done this. But if you haven't, it's helpful to check out Andrew Embler's "how to" video:
http://www.concrete5.org/documentation/how-tos/designers/make-a-the...

Be sure you're walking through all the steps correctly--I've botched themes before and had to review it. Although this video isn't made using 5.5 or higher, themes built this way should still function properly.
Sicon replied on at Permalink Reply
Works fine with all the default themes, watched the video, did what i said to do, even reinstalled c5. I'm am completely baffled, I'm not a complete noob at this stuff either, but this sure has stumped me.
Sicon replied on at Permalink Reply
Got it to work using
<?php echo $this->getThemePath()?>

And in order to get the header to work I had to have the footer added into it also.

Not sure if this is the proper way but it's the only way I got to work for me now..
clmedia replied on at Permalink Reply
clmedia
Using <?php echo (); ?> is the same thing as <?= ?>, so it still sounds like there's a short-tags issue going on. But I have run across the issue where the footer_required call is necessary. See this post (towards the end):https://www.concrete5.org/community/forums/documentation_efforts/new...