PHP Website (Solved)

General questions regarding the usage of CodeLite
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

PHP Website (Solved)

Post by nezos »

My setup: Debian with Apache

Created a new PHP project, selected the project execution mode "Run project as website".
In the Debug of Project Settings I set the mapping: source: /myfolder/myproject target: /
In General of Project Settings I've set Project URL: mysite (tried also mysite/index.php)

When i run the project I see the default webpage of Apache and not the project's webpage (if i use mysite/index.php i get file not found from apache). Any idea what's wrong?

Additionally: should I run codelite as root? does codelite read apache's configuration files?

Thanks
Last edited by nezos on Wed Jan 25, 2017 9:33 pm, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: PHP Website

Post by eranif »

when running it from the browser, does it work?
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: PHP Website

Post by nezos »

I'm sorry I don't think I understand what you mean,

Open the PHP file with the browser? Place it on the var/www/html path of Apache? If you are asking about Apache, it works.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: PHP Website

Post by eranif »

I mean, in the project execution dialog, you should write something like:
http://www.mydomain.com/index.php (a full URL)

My question was, when typing this URL in a browser, does it work? i.e. do you get your site or Apache's default page?
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: PHP Website

Post by nezos »

Outside Codelite, I have apache installed but I haven't changed the default webpage.

From Codelite, if I type the URL without index.php I get the default webpage I get outside of Codelite.

Hope this makes sense.
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: PHP Website

Post by nezos »

Answer is:

Create a symlink like:

If your project is located at /home/myuser/myproject

and your apache server root directory is /var/www/html

then as root run inside /var/www/html the following:

ln -s /home/myuser/myproject myproject

Then in Codelite use a URL like:

localhost/myproject
Post Reply