SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-01-09 22:23:40

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

[SOLVED] PHP Cannot get started

I have installed LAMP stack via the CB-Welcome script.
The Apache server works and I get the "It works" page when pointing browser at localhost.
I created a php test by modifying the "It works" index.html and saving it in david/htdocs ast test.html and also as test.php

Then browser to localhost/david/test.html gives....

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

This is PHP test"
; phpinfo(); ?>

Then browser to localhost/david/test.php gives...

Server error
The website encountered an error while retrieving http://localhost/david/test.php. It may be down for maintenance or configured incorrectly.

Clearly it is not down but may well be configured incorrectly. Any suggestions or advice?

Thanks, David

Last edited by dbvolvox (2012-01-12 23:08:11)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-01-09 22:28:50

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: [SOLVED] PHP Cannot get started


I'm so meta, even this acronym

Offline

#3 2012-01-09 22:51:05

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

Sorry Awebb but I cannot see anything in this wiki that helps:(

Last edited by dbvolvox (2012-01-09 22:51:40)

Offline

#4 2012-01-09 23:22:12

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: [SOLVED] PHP Cannot get started

It's more like a checklist.

( ) Are all the packages installed, as discribed in the article?
( ) Yes? Are they? Those too? php5 php5-mysql libapache2-mod-php5?

If yes, please use the pastebin and show us your config files (for apache and so on).


I'm so meta, even this acronym

Offline

#5 2012-01-10 13:53:39

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

Yes, all packages are installed. The config files are the defaults loaded during cb-welcome, I haven't changed any.  Phpmyadmin will  not load either, i.e. localhost/phpmyadmin gives broken link error.

Offline

#6 2012-01-10 14:19:22

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: [SOLVED] PHP Cannot get started

here's what i did: http://crunchbanglinux.org/forums/post/172739/#p172739

this worked for me immediately. did you do those exact steps (including the symlink-stuff?). and do you have the htdocs-dir?

Offline

#7 2012-01-10 14:52:46

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

rhowaldt wrote:

here's what i did: http://crunchbanglinux.org/forums/post/172739/#p172739

this worked for me immediately. did you do those exact steps (including the symlink-stuff?). and do you have the htdocs-dir?

I was following that advice! So expected it to work! Yes I did the symlink and yes I have the htdocs directory and Apache runs the html files saved there but not the php ones.

Offline

#8 2012-01-10 15:22:19

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: [SOLVED] PHP Cannot get started

have you tried to restart Apache? or check whether it is really running?
html-pages show in your browser anyway, with or without Apache. you just need it for the PHP. so it might as well not be running and you wouldn't know, right?

as per the other post in the linked thread:

sudo apache2ctl start

Offline

#9 2012-01-10 15:29:15

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

rhowaldt wrote:

have you tried to restart Apache? or check whether it is really running?
html-pages show in your browser anyway, with or without Apache. you just need it for the PHP. so it might as well not be running and you wouldn't know, right?

as per the other post in the linked thread:

sudo apache2ctl start

Yes and I get 'httpd (pid 2747) already running'

Offline

#10 2012-01-10 15:42:05

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: [SOLVED] PHP Cannot get started

well, ok, in that case i don't know what to do next. at least now we know all that isn't where the problem is smile

Last edited by rhowaldt (2012-01-10 15:42:13)

Offline

#11 2012-01-10 15:51:09

dkeg
#! Die Hard
From: PA
Registered: 2011-12-05
Posts: 565

Re: [SOLVED] PHP Cannot get started

Just a thought, but maybe try to bypass the symlink and place the file directly in /var/www


the rocky path may just be the best path  | community  |  linuxbbq | dotshare

Offline

#12 2012-01-10 23:22:43

vlahonick
Banned
From: Universe
Registered: 2011-12-03
Posts: 347

Re: [SOLVED] PHP Cannot get started

increase error reporting and check ur logs. then plz copy/paste it here. it might be helpfull
to see what exactly is happenig when u try to locate the file.

anyway what exactly u want to do with LAMP ? if u let us know what this is all about
we might provide another more simple solution.

mine is to remove all php, phpmyadmin, apache and lamp related stuff, make
autoremove as well and the do a clean install of all the packages by using the
command below:

sudo apt-get install mysql-server mysql-client apache2 apache2-doc php5 php5-mysql libapache2-mod-php5 phpmyadmin

also are u sure the permissions and all the simple stuff that might cause problems are
eliminated?


"I do not fear computers. I fear the lack of them."
Isaac Asimov

Offline

#13 2012-01-11 17:45:17

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

vlahonick wrote:

anyway what exactly u want to do with LAMP ? if u let us know what this is all about
we might provide another more simple solution.

also are u sure the permissions and all the simple stuff that might cause problems are
eliminated?

I just wanted a simple development web server set up so that I could learn php programming, but seem to have stumbled at the first hurdle.

I will go through a re-install tomorrow but in answer to your question about permissions and simple stuff, no I am not sure!

Offline

#14 2012-01-11 17:47:59

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: [SOLVED] PHP Cannot get started

If you just want to learn php, why not directly invoke php on the php file like this:

php5 /path/to/test/php.php

  That's what I do to test my scripts and stuff.


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

#15 2012-01-11 18:56:50

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: [SOLVED] PHP Cannot get started

^ what? you can do that? damn! i love linux smile

Offline

#16 2012-01-11 21:15:53

vlahonick
Banned
From: Universe
Registered: 2011-12-03
Posts: 347

Re: [SOLVED] PHP Cannot get started

is possible with chaanakya's way but i rly think is better to learn and setup ur server
correct from now bacause in some months or at least when u became more advanced
in php u might want to have a production enviroment for ur projects or clients who knows smile


"I do not fear computers. I fear the lack of them."
Isaac Asimov

Offline

#17 2012-01-12 10:30:22

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

Chaanakya's Way (a great Proustian feel don't you think) has opened the door and enabled me to debug the script- would you believe my very first php tag was wrong! grrrr I had <?php> curse that pesky >.

I do get an error report that php can't find curl.so but I am assuming I don't need it.

Only issue I now have is how to start PhpMyAdmin?

Offline

#18 2012-01-12 12:50:03

vlahonick
Banned
From: Universe
Registered: 2011-12-03
Posts: 347

Re: [SOLVED] PHP Cannot get started

are u sure phpmyadmin is installed??? check on synaptic if it is, if is not just install it...
i am not 100% but i think choosing to install apache during installation does not
install phpmyadmin. (might be wrong, dont rly remember but plz check out if is installed).


"I do not fear computers. I fear the lack of them."
Isaac Asimov

Offline

#19 2012-01-12 13:35:39

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

I have got it to run by copying the phpmyadmin folder from /usr/share to /htdocs but setup will not work properly without a writable config folder.  So far I haven't been able to find the right location for this?

Offline

#20 2012-01-12 13:40:56

dkeg
#! Die Hard
From: PA
Registered: 2011-12-05
Posts: 565

Re: [SOLVED] PHP Cannot get started

phpmyadmin doens't run from w/in htdocs

I don't have phpmyadmin yet on #!, but when I set lammp up in ubuntu it had created a lampp directory in /opt and phpmyadmin was in there along with htdocs

try putting it in /var/www


the rocky path may just be the best path  | community  |  linuxbbq | dotshare

Offline

#21 2012-01-12 18:59:50

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

It shows in var/www because I put it in htdocs.

Offline

#22 2012-01-12 20:11:21

dkeg
#! Die Hard
From: PA
Registered: 2011-12-05
Posts: 565

Re: [SOLVED] PHP Cannot get started

I installed the lampp configuration thru the install scripts.  I have phpmyadmin by default. 

it is in the /etc directory.

now, to get it to 'work'...

open up your apache2.conf file -> /etc/apache2/apache2.conf

add in this line at the end

Include /etc/phpmyadmin/apache2.conf

then restart apache

sudo /etc/init.d/apache2 restart

then you will find it by using

localhost/phpmyadmin

the rocky path may just be the best path  | community  |  linuxbbq | dotshare

Offline

#23 2012-01-12 23:07:11

dbvolvox
#! Member
From: England
Registered: 2011-01-05
Posts: 66

Re: [SOLVED] PHP Cannot get started

Thank you dkeg that worked.(except for some reason /etc/phpmyadmin/apache2.conf has lost its 2!)

Thank you all for your helpful suggestions. I now have working apache, php5, phpmyadmin, mysql.

No doubt I will be back when I get into the php learning.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo