Senin, 01 Juli 2013

error short tag pada program php di centos 6

 

pengalaman ini ketika saya mendapat ke anehan ketika menjalakan aplikasi di server centos yang berupa sytax error. dan pada komputer lokal kode program ini berjalan normal, yang mana komputer lokal yang saya gunakan adalah Lubunutu.

 

jadi si centos ini hanya mengenal tag php <?php tetapi tidak mengenal tag <? , jika menuliskan kode php dengan awalan <? maka terjadilah sytax error, dan sebagai informasi framework php yang di gunakan adalah yii framework.

dan tampilan error adalah seperti ini. :
Parse error: syntax error, unexpected $end in /var/www/html/apps/protected/views/as/index.php on line 231 Call Stack:

jadi bagai mana memperbaikinya. mudah ;)

buka konfigurasi di  php.ini
vim /etc/php.ini

cari tulisan short_open_tag  pada server saya pada baris 229 dan ubah menjadi On.

 









From capture from computer

demikian mudah kan :D

error short tag in php programing on centos 6

well this experience I got when I use centos 6 server as appliation server, partial code are running but some are sytax error, don't know that make crazy. even though I know that already crazy. :D haha

the strange things is because that code running well on my local computer that use Lubuntu, wtf what's wrong with this server. well done I give up with this condition but a friend as gurus tell that is problem in short tag which is php on that server didn't recognize sytax <? instead just <?php  oh wow, I just know this problem, never know before, hahaha. well I am newbie. hmm also for information that use php framework called yii.

and error showing like this :
Parse error: syntax error, unexpected $end in /var/www/html/apps/protected/views/as/index.php on line 231 Call Stack:

 

so how to resolve it on centos server. ?? easy ;)

just open configuration ini php.ini
vim /etc/php.ini

search line writing short_open_tag  that is on line 229 on my server. change that to on.

 









From capture from computer

well done. our duty finish.