8 Replies - 716 Views - Last Post: 18 June 2008 - 09:33 AM Rate Topic: -----

#1 chrisd234  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-June 08

Unable to get php code to process on local server

Post icon  Posted 14 June 2008 - 02:02 PM

Okay so I'm still working on my website that i'm using to learn php.

So far I've got a a decently working posting system using a database, a few html tables, etc. I dont know html either so this is all a learning experience.

I just spent the last 2 hours tweaking and pulling my hair out wondering why my file uploading script wasnt working.

No matter what tutorial I followed it wouldnt work. I use my laptop as my sandbox server, running wamp. So this means that the site is hosted on my laptop. I was refreshing 'localhost' in my laptop over and over again.

after about 2 hours I tested it from my other computer and realized that there was nothing wrong with ANY of my code. It just doesnt work to 'upload' the file from the same computer the server is on.

Is there some kinda work around for this? I've also tried visiting my IP address directly rather than localhost and it still returns an error. Anyone been in this type of situation before?



I do run 2 web servers at home, I guess I'll transfer this over to the other computer and then work on it remotely from this one and refresh.

I would upload it to standard webhosting but I dont have paid hosting account, and I've tried X10 but they seem to be down or have alot of errors.


Any thoughts?

Is This A Good Question/Topic? 0
  • +

Replies To: Unable to get php code to process on local server

#2 MitkOK  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 32
  • View blog
  • Posts: 403
  • Joined: 09-August 07

Re: Unable to get php code to process on local server

Posted 14 June 2008 - 02:34 PM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 chrisd234  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-June 08

Re: Unable to get php code to process on local server

Posted 14 June 2008 - 02:40 PM

View PostMitkOK, on 14 Jun, 2008 - 02:34 PM, said:

[rules][/rules]


????? I wasnt asking for help with code in particular. I was just asking about work arounds for some problems programmers might have with writing and running code on their computer when it serves as the server at the same time.

I dont need code. I have the code working fine. I was asking about experiences and what others prefer, or how they work/write their code at home
Was This Post Helpful? 0
  • +
  • -

#4 MitkOK  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 32
  • View blog
  • Posts: 403
  • Joined: 09-August 07

Re: Unable to get php code to process on local server

Posted 14 June 2008 - 03:48 PM

I'm writing and testing code first on my computer and everything works fine.
Maybe you didn't configured the server right.
Was This Post Helpful? 0
  • +
  • -

#5 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Unable to get php code to process on local server

Posted 14 June 2008 - 09:50 PM

I've always uploaded to my paid server to run the test. If you don't need more than a basic server to upload your script to, I can give you ftp access to one of my directories for a day or two. You'd have to get everything tested and working by then though. I could set you up tomorrow and let you use it through Tuesday or so.
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5322
  • View blog
  • Posts: 27,232
  • Joined: 10-May 07

Re: Unable to get php code to process on local server

Posted 14 June 2008 - 09:52 PM

A simple page like the following should show if you if everything is correctly configured.

<?php
phpinfo();
?>



If this doesn't give you a rundown of your php install, then check the logs for your web server software, as they should be filled with relevant errors.
Was This Post Helpful? 0
  • +
  • -

#7 joeyadms  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 178
  • Joined: 04-May 08

Re: Unable to get php code to process on local server

Posted 15 June 2008 - 03:16 AM

It all depends on what error you are getting. Your code may not be cross-platform, or your server configuration may be wrong..

Run phpinfo() like no2pencil said, only do it like this
Test
<?php phpinfo(); ?>



That way you should have 'SOME' output, even if php is not working.

Heres some common things that could happen.

1. It works fine with .php but not as .html
Answer: In php.ini, change your addtype to include .html

2. It asks you to download the php page.
Answer: In php.ini, you need to add an addtype declaration

3. Blank White Page
Answer: PHP error, turn on display errors in php.ini to find your problem

4. Connection Timed Out
Answer: You need to start your http server.


Also I'll say it again here, unless you need PHP4 support, I highly suggest using ZendCore to install apache/php
Was This Post Helpful? 0
  • +
  • -

#8 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: Unable to get php code to process on local server

Posted 18 June 2008 - 06:29 AM

Guys, he mentioned this in his original post:

View Postchrisd234, on 14 Jun, 2008 - 10:02 PM, said:

So far I've got a a decently working posting system using a database, a few html tables, etc.


Isnt asking him to run phpinfo a tad bit crossing the line ?
Was This Post Helpful? 0
  • +
  • -

#9 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Unable to get php code to process on local server

Posted 18 June 2008 - 09:33 AM

View PostTrogdor, on 18 Jun, 2008 - 09:29 AM, said:

Guys, he mentioned this in his original post:

View Postchrisd234, on 14 Jun, 2008 - 10:02 PM, said:

So far I've got a a decently working posting system using a database, a few html tables, etc.


Isnt asking him to run phpinfo a tad bit crossing the line ?


They want him to run phpinfo() to check that php is running on his local machine.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1