Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-25 18:48:08

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

TXP:PHP tags crash Apache

I am currently useing Textpattern version: 4.0.1 (r1058) on our internal server is running Apache2 and PHP5 and MYSQL4

I made a ping script the pings certain IP address at page load and returns wether that IP is UP or DOWN so our employee’s can see if the E-mail Server or the other severs are online.

I place the php render code between the < TXP:PHP> and < /TXP:PHP> and when I goto test the page out Apache crash’s.

I know the ping script works fine outside of TXP cause i made a static php page and placed my code there and it works but when i do it in TXP it crash’s Apache.

Any ideas.


Ryan

Offline

#2 2005-10-25 19:29:14

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: TXP:PHP tags crash Apache

You are making a bug report to us? Are you suggesting that we write code to work around every possible bug that might exist in any of the PHP/Apache/Mysql versions and could crash them? I hope not…. :D

You should try updating all your other related software to the most recent, and if you still have the problem, you should submit a bug report to (most likely) PHP (I am guessing you are using mod_php?) or maybe Apache.

To file a proper bug report with them, you have to isolate the problem to as little lines as possible. Here’s something to get you started: When parsing a template (roughly) the following happens

parse() (publish.php)
=> preg_replace_callback()
=> calls processTags() (publish.php) calls php() (for txp:php-tags)
=> php() (taghandlers.php) basically only does an eval().

You should be able figuring out what happens around it. Good luck in hunting it down and with your bug-report with them (it’s a lot busier and terse over there…). But make sure you are using recent versions of apache and php or they may have fixed it already…

Offline

#3 2005-10-25 19:30:26

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: TXP:PHP tags crash Apache

PHP placed within <txp:php> gets eval()-ed, which I would guess is the source of the problem. Try putting it instead in an include, and place an include statement within the <txp:php> tag.

Offline

#4 2005-10-25 19:37:59

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

Re: TXP:PHP tags crash Apache

No Sencer im not thinking that way, i was just stateing that the PHP code works fine until i place it into TXP. Than i get Tag errors show up and than Apcahe crash’s.

I just have been getting this error:

Parse error: parse error, unexpected $ in /home/linux1/www/_txp/publish/taghandlers.php(1662) : eval()’d code on line 1

And sence it said in taghandlers.php i thought i would post it here.

I did manage to get it to stop crashing Apache.

Thanks mary that works.

Last edited by NXArmada (2005-10-25 19:48:16)


Ryan

Offline

#5 2005-10-25 21:58:35

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: TXP:PHP tags crash Apache

Than i get Tag errors show up and than Apcahe crash’s.

Do you really mean that the httpd process dies? Or just that there’s a fatal PHP error?

Parse error: parse error, unexpected $ in /home/linux1/www/_txp/publish/taghandlers.php(1662) : eval()’d code on line 1

This was caused by a syntax error in your PHP code. Perhaps a copy-paste error. Is this the full extent of the problem?


Alex

Offline

#6 2005-10-26 12:11:02

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

Re: TXP:PHP tags crash Apache

“Do you really mean that the httpd process dies? Or just that there’s a fatal PHP error?”

Yea the httpd process does die. Yea I know that weird.


Ryan

Offline

#7 2005-10-26 12:26:35

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: TXP:PHP tags crash Apache

Yea the httpd process does die.

Can you find an error message in the logs?

As Sencer said, this is an Apache or PHP bug – there should be nothing a PHP script can do to take down a server.


Alex

Offline

#8 2005-10-26 15:39:45

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

Re: TXP:PHP tags crash Apache

No worries i think i fixed the problem.


Ryan

Offline

#9 2005-10-26 21:06:31

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: TXP:PHP tags crash Apache

Care to tell us how?


Alex

Offline

#10 2005-10-27 12:57:16

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

Re: TXP:PHP tags crash Apache

yea just not use my script period lol. theres a programming error in my script. and i removed the script tell i get it working right. Appearntly it dosen’t like to be included into other php files.


Ryan

Offline

Board footer

Powered by FluxBB