Page 1 of 2

Newbie - .php files downloading not running [Solved]

PostPosted: 14. February 2013 22:45
by Yan
Hi there,

I installed lampp 1.8.1 so I could learn php. When I try and run scripts on xampp my .php files download instead of running.

I think I may need to change something in opt/lampp/etc/httpd.conf but I am not too knowledgeable about linux or servers or anything, so I will really appreciate your help, but please go step by step, as if to an idiot :D

Here is my error log for today, when I have tried to run the scripts. /lampp/logs/php_error_log is empty

[Thu Feb 14 17:46:29.139707 2013] [ssl:warn] [pid 10416] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Feb 14 17:46:29.166510 2013] [ssl:warn] [pid 10416] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Feb 14 17:46:29.166610 2013] [suexec:notice] [pid 10416] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Thu Feb 14 17:46:29.569814 2013] [auth_digest:notice] [pid 10417] AH01757: generating secret for digest authentication ...
[Thu Feb 14 17:46:30.060514 2013] [ssl:warn] [pid 10417] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Feb 14 17:46:30.063099 2013] [ssl:warn] [pid 10417] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Feb 14 17:46:30.063233 2013] [lbmethod_heartbeat:notice] [pid 10417] AH02282: No slotmem from mod_heartmonitor
[Thu Feb 14 17:46:30.083604 2013] [mpm_prefork:notice] [pid 10417] AH00163: Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Thu Feb 14 17:46:30.083725 2013] [core:notice] [pid 10417] AH00094: Command line: '/opt/lampp/bin/httpd -D SSL -D PHP5 -E /opt/lampp/logs/error_log'
[Thu Feb 14 21:13:36.694087 2013] [mpm_prefork:notice] [pid 10417] AH00169: caught SIGTERM, shutting down

Thanks in advance for any time you spend helping me out,

Re: Newbie - .php files downloading not running

PostPosted: 15. February 2013 01:38
by Yan
OK, just checked php.info and mod_php5 is loaded. Which was something to check.

Re: Newbie - .php files downloading not running

PostPosted: 20. February 2013 18:09
by JonB
Question one;

What happens when you try to go to http://localhost??? :shock:

Do you get the XAMPP Welcome Page?

8)

Re: Newbie - .php files downloading not running

PostPosted: 20. February 2013 23:18
by Yan
Yes, I get the xampp welcome page. Xampp is running fine, and I have joomla installed.

Re: Newbie - .php files downloading not running

PostPosted: 21. February 2013 18:23
by JonB
Well - if the XAMPP page loads and works - that means Apache and PHP are working basically correctly.

Thus - most likely a permissions or ownership issue

8)

Re: Newbie - .php files downloading not running

PostPosted: 21. February 2013 20:59
by Yan
Thanks a lot for your help by the way!

So I CHMODed /opt/lampp recurively to 777, but I still have the same problem? :?

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 15:04
by JonB
Did you check the ownership?

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 15:16
by Nobbie
What do enter in the browser URL line in order to start your own PHP scripts?

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 21:50
by Yan
OK! Now I CHOWNed everything in /opt/lampp to me (user). But I still have the same problem! Does it all need to be owned by root?

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 22:03
by Yan
OK, guess I busted up my installation with the previous CHMOD command. MYSQL was not starting after I CHMODed /opt/lampp/etc/my.cnf to 777. I put it back too 751.

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 22:04
by Yan
But (and I thank you for sticking with me so far) I still have the same problem! ;D

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 22:15
by Yan
@ Nobbie - scripts are running from a webform submit button

Re: Newbie - .php files downloading not running

PostPosted: 22. February 2013 23:26
by Nobbie
Yan wrote:@ Nobbie - scripts are running from a webform submit button


And what do you enter in the Browser URL to load the file which contains the webform?

Re: Newbie - .php files downloading not running

PostPosted: 23. February 2013 09:39
by Yan
Thanks Nobbie, it is this: file:///opt/lampp/htdocs/webform.html

Re: Newbie - .php files downloading not running

PostPosted: 23. February 2013 09:45
by Altrea
Hi Yan,

Yan wrote:it is this: file:///opt/lampp/htdocs/webform.html

php is a serverside programming language. That means it will not get processed with the file:// protocol (this is true even if the php file is adressed by an html form). It needs to be requested.
Instead of file:///opt/lampp/htdocs/webform.html please try this url: http://localhost/webform.html

best wishes,
Altrea