Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-05-2008, 01:00 PM
|
#1
|
Member
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510
Rep:
|
PHP and Java. Steps to follow to be able to start using them.
Hello back!
I would like to start Programming in PHP and Java under Slackware (12.1). So, I would really appreciate if you could help and tell me everything I have to install or check If they are already installed to be able to start programming under both of them (PHP and Java). Advices and book recommendations will be also very welcome.
Please, answers should be for a "newbie".
Thank you!
Glore2002.-
|
|
|
10-05-2008, 01:19 PM
|
#2
|
Senior Member
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079
Rep:
|
if you did a full install, everything is setup to start programming in php, but for java you need the JDK.
|
|
|
10-05-2008, 01:52 PM
|
#3
|
Senior Member
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367
|
JDK is available in extra/ on your install CD (CD 4)/DVD or from your favourite Slackware mirror.
|
|
|
10-05-2008, 02:04 PM
|
#4
|
Member
Registered: May 2004
Distribution: Slackware.
Posts: 323
Rep:
|
I do most of my Java programming on Slackware...it's a breeze.
As said the JDK is available in /extra.
Both Netbeans and Eclipse work effortlessly on Slack.
|
|
|
10-06-2008, 02:02 PM
|
#5
|
Member
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510
Original Poster
Rep:
|
Thanks!
Thanks for your replies. I've installed JDK. Now I will install Eclipse and /or Netbeans.
What else should I install? Apache, MySQL?
I really appreciate your help.
Glore2002.-
Last edited by glore2002; 10-06-2008 at 02:25 PM.
|
|
|
10-06-2008, 06:07 PM
|
#6
|
Senior Member
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079
Rep:
|
Quote:
Originally Posted by glore2002
Thanks for your replies. I've installed JDK. Now I will install Eclipse and /or Netbeans.
What else should I install? Apache, MySQL?
I really appreciate your help.
Glore2002.-
|
it might be a good idea to install mysql if you are going to use database in php, and you only need apache if you going to be hosting a website on your machine
|
|
|
10-06-2008, 06:26 PM
|
#7
|
Member
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510
Original Poster
Rep:
|
Quote:
Originally Posted by AceofSpades19
it might be a good idea to install mysql if you are going to use database in php, and you only need apache if you going to be hosting a website on your machine
|
Ohh, I see. I thought Apache was necessary as well as MySQL. I've activated both of them.
So, if I write a program in PHP such as:
Code:
<html>
<head>
<title></title>
</head>
<body>
<h3>My first php program</h3>
<?php echo "hello my world"; ?>
<hr>
</body>
</html>
And I save it as hello.php
What should I do to make it work?
Thanks,
Glore2002.-
|
|
|
10-06-2008, 07:06 PM
|
#8
|
Member
Registered: Jun 2007
Location: Australia
Distribution: Slackware
Posts: 86
Rep:
|
I think all I had to do to get PHP working was edit /etc/httpd/httpd.conf:
Code:
# Uncomment the following line to enable PHP:
#
Include /etc/httpd/mod_php.conf
I also enabled user home directories for testing by uncommenting the following line:
Code:
# User home directories
Include /etc/httpd/extra/httpd-userdir.conf
which meant I could put my php files in /home/gsl/public_html and access them using http://localhost/~gsl/file.php. If you edit httpd.conf, restart Apache (or start it if, like me, you don't run it by default).
A good PHP test file is:
Code:
<?php phpinfo(); ?>
There may be some step I have forgotten. My PHP experience is limited.
Geoff.
|
|
|
10-06-2008, 07:47 PM
|
#9
|
Member
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510
Original Poster
Rep:
|
Quote:
Originally Posted by gsl
I think all I had to do to get PHP working was edit /etc/httpd/httpd.conf:
Code:
# Uncomment the following line to enable PHP:
#
Include /etc/httpd/mod_php.conf
I also enabled user home directories for testing by uncommenting the following line:
Code:
# User home directories
Include /etc/httpd/extra/httpd-userdir.conf
which meant I could put my php files in /home/gsl/public_html and access them using http://localhost/~gsl/file.php. If you edit httpd.conf, restart Apache (or start it if, like me, you don't run it by default).
A good PHP test file is:
Code:
<?php phpinfo(); ?>
There may be some step I have forgotten. My PHP experience is limited.
Geoff.
|
Thank you!
It worked perfectly well.
Glore2002.-
|
|
|
10-07-2008, 04:20 AM
|
#10
|
Member
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510
Original Poster
Rep:
|
Quote:
Originally Posted by tamtam
I do most of my Java programming on Slackware...it's a breeze.
As said the JDK is available in /extra.
Both Netbeans and Eclipse work effortlessly on Slack.
|
After installing JDK What can I do to check Java was installed fully and correctly?
Thanks,
Glore2002.-
|
|
|
10-07-2008, 09:05 AM
|
#11
|
Member
Registered: May 2004
Distribution: Slackware.
Posts: 323
Rep:
|
To check whether the JDK is installed correctly...
java -version
will determin the version of the jre - same as installation...
javac --help
should show you the options for the javac command...
Or Alterantively create a simple test program...HelloWorld would suffice...
compile it with javac...execute the resulting class file with java (remember the classpath)...
It would also be good idea to edit the sh files in /etc/profile.d relating to your new java installation...
|
|
|
All times are GMT -5. The time now is 02:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|