LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-05-2008, 01:00 PM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Rep: Reputation: 33
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.-
 
Old 10-05-2008, 01:19 PM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
if you did a full install, everything is setup to start programming in php, but for java you need the JDK.
 
Old 10-05-2008, 01:52 PM   #3
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
JDK is available in extra/ on your install CD (CD 4)/DVD or from your favourite Slackware mirror.
 
Old 10-05-2008, 02:04 PM   #4
tamtam
Member
 
Registered: May 2004
Distribution: Slackware.
Posts: 323

Rep: Reputation: 33
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.
 
Old 10-06-2008, 02:02 PM   #5
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
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.
 
Old 10-06-2008, 06:07 PM   #6
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by glore2002 View Post
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
 
Old 10-06-2008, 06:26 PM   #7
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by AceofSpades19 View Post
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.-
 
Old 10-06-2008, 07:06 PM   #8
gsl
Member
 
Registered: Jun 2007
Location: Australia
Distribution: Slackware
Posts: 86

Rep: Reputation: 68
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.
 
Old 10-06-2008, 07:47 PM   #9
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by gsl View Post
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.-
 
Old 10-07-2008, 04:20 AM   #10
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by tamtam View Post
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.-
 
Old 10-07-2008, 09:05 AM   #11
tamtam
Member
 
Registered: May 2004
Distribution: Slackware.
Posts: 323

Rep: Reputation: 33
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what steps to follow when you have to recompile? echnat0n Linux From Scratch 1 05-07-2007 10:51 AM
Suddenly 100% of hard disk usage. What steps should i follow? stormrider_may Linux - Security 9 03-07-2006 05:49 PM
what steps to follow when reentering chroot iam whoiam Linux From Scratch 3 02-13-2005 09:12 AM
first steps a new admin must follow ddaas Linux - Newbie 3 12-21-2004 04:53 PM
first steps a new admin must follow ddaas Linux - General 3 12-21-2004 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration