13 Replies - 2176 Views - Last Post: 15 December 2012 - 08:43 PM

#1 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

php says actvated?

Posted 15 December 2012 - 07:52 PM

i run xampp
it says activated under status (when i check local host)
i run a simple script
it says hello world
i change the text to 'hi'
refresh, it still says hello world?
i run different script
it says 'object not found on this server' etc

is php activated or not?

any user controls to make sure things are running fine?

thanks...
Is This A Good Question/Topic? 0
  • +

Replies To: php says actvated?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: php says actvated?

Posted 15 December 2012 - 07:59 PM

It's kind of hard to guess what the problem is based on that description, but my best guess is that you are editing the wrong files. Can you show us the code you are using, the paths to the files on your hard drive, and the URLs you are putting into the browser?

By the way, I've moved this thread to the Web Servers & Hosting forum. This isn't really a PHP problem.
Was This Post Helpful? 1
  • +
  • -

#3 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: php says actvated?

Posted 15 December 2012 - 08:09 PM

something simple like this

<html>
<body>

<?php
echo "Hello World";
?>

</body>
</html>


i am saving them in a random spot not 'htdocs' could this be an issue?
as far as the urls i am just running them locally in dreamweaver

This post has been edited by Dormilich: 16 December 2012 - 02:37 AM
Reason for edit:: please use [CODE] [/CODE] tags when posting code

Was This Post Helpful? 0
  • +
  • -

#4 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: php says actvated?

Posted 15 December 2012 - 08:14 PM

thanks for the speedy reply

essentially im just creating a page in which i am testing if php is truly activated

should all php enabled files be saved under htdocs?

i tried reinstalling xampp a few times and deleted htdocs, i dont think it was installed a second time.

i deleted the entire program from my harddrive...i was considering wiping the whole thing and installing it again but that seems unessesary... is there a sure fire way for me to install apache and have php run fine?

mind you the status said 'activated' under local host

thanks...
Was This Post Helpful? 0
  • +
  • -

#5 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: php says actvated?

Posted 15 December 2012 - 08:18 PM

The Apache server in XAMPP severs files from the 'htdocs' folder. If the file isn't in there, it won't be accessible via the Apache server.

I don't know what "running them locally in dreamweaver" means exactly. (Dreamweaver is kind of crap when it comes to PHP coding, so I haven't really used it for years.) What I wanted to know is what URL is showing in the browser, regardless of how you got there.
Was This Post Helpful? 1
  • +
  • -

#6 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: php says actvated?

Posted 15 December 2012 - 08:24 PM

after downloading it said...

some features of xampp may not be available to me due to certain user account settings

is there a way to override all of this under admin? it said activated after all

shouldnt the fact that it echoed hello world be proof enough its installed?

im sure theres a fix for this

thanks

ill make sure htdocs is used correctly this time.

is there a way to manually create the folder if it isnt installed with the program? thanks...

the url would be something like this then

file:///C:/Users/billion/Documents/Unnamed%20Site%202/final%20kam.html
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9199
  • View blog
  • Posts: 34,567
  • Joined: 12-June 08

Re: php says actvated?

Posted 15 December 2012 - 08:28 PM

Quote

ile:///C:/Users/billion/Documents/Unnamed%20Site%202/final%20kam.html


Well there's the problem - you are not calling the file through the apache server! You direct file access, but instead use a browser to navigate to 'localhost/... file path.../final%20kam.html'.
Was This Post Helpful? 0
  • +
  • -

#8 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: php says actvated?

Posted 15 December 2012 - 08:34 PM

View Postmodi123_1, on 15 December 2012 - 08:28 PM, said:

Quote

ile:///C:/Users/billion/Documents/Unnamed%20Site%202/final%20kam.html


Well there's the problem - you are not calling the file through the apache server! You direct file access, but instead use a browser to navigate to 'localhost/... file path.../final%20kam.html'.


yes yankee
would the fix for this to be to save the files in htdocs from now on then?
thank you...

is that what you meant? otherwise im still not entirley sure...all i do is hot f12 and dreamweaver sends the code to the broser and generates the url locally of course...

thanks guys..
Was This Post Helpful? 0
  • +
  • -

#9 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9199
  • View blog
  • Posts: 34,567
  • Joined: 12-June 08

Re: php says actvated?

Posted 15 December 2012 - 08:35 PM

yeah.. but you need to also ADDRESS them right. A apache server isn't just a plain ol' file system... you request it to find a file or load a page for you.. not just open it up!

You have to look at this from the perspective of the apache server.. where would *it* find files? where does *IT* consider a local host?
Was This Post Helpful? 2
  • +
  • -

#10 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: php says actvated?

Posted 15 December 2012 - 08:39 PM

It's a fairly simple concept.

You save PHP code in a file at: C:\xampp\htdocs\test.php. Then you navigate to http://localhost/test.php to execute that PHP file. If you go to something like file:///C:/xampp/htdocs/test.php, then the PHP code WONT be executed, because you are not accessing the file through XAMPP.

jimbang said:

all i do is hot f12 and dreamweaver sends the code to the broser and generates the url locally of course...

Then don't do that. There is no need for it in any case. Just open a browser and type in the URL.

Seriously, I'd suggest not using Dreamweaver at all to begin with. It'll just complicate matters. While you're learning, you're better of using something simpler like Notepad++.
Was This Post Helpful? 2
  • +
  • -

#11 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9199
  • View blog
  • Posts: 34,567
  • Joined: 12-June 08

Re: php says actvated?

Posted 15 December 2012 - 08:40 PM

Amen to that atli... it doesn't do anyone any favors with cementing how one goes about getting files from a server!
Was This Post Helpful? 0
  • +
  • -

#12 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: php says actvated?

Posted 15 December 2012 - 08:40 PM

thank you,
again, ill try to use htdocs correctly this time hopefully that will straighten everything out since the status was activated, hopefully i can help you out some time lol

is there a way to manually create an htdocs path? i dont think it was installed last time...is this unheard of?

ill try reinstalling thanks :)
Was This Post Helpful? 0
  • +
  • -

#13 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9199
  • View blog
  • Posts: 34,567
  • Joined: 12-June 08

Re: php says actvated?

Posted 15 December 2012 - 08:42 PM

Quote

is there a way to manually create an htdocs path? i dont think it was installed last time...is this unheard of?

It should be automatically be there.

Mine is located

C:\xampp\htdocs
Was This Post Helpful? 0
  • +
  • -

#14 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: php says actvated?

Posted 15 December 2012 - 08:43 PM

your right about dw, i use notpad too but the gui is easy for css and stuff/ very well put both of you

changed the way i think about 'path'
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1