LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-29-2014, 02:26 PM   #1
slayerking
Member
 
Registered: Apr 2011
Posts: 60

Rep: Reputation: 3
autostart xampp help


Im having a strange problem with auto starting xampp. As one post suggested to add

Quote:
/opt/lampp/lampp start
to the /etc/rc.d/rc.local file. Its auto starting pretty well. But im facing another problem by this approach.

When I try to use any php http wrapper functions like:
Quote:
echo file_get_contents('http://www.google.com');
I get error as follows
Quote:
Error: Couldn't resolve host 'www.google.com'
If I restart the server
Quote:
/opt/lampp/lampp stop
/opt/lampp/lampp start
that fixes the issue. So, I have to do this every time as I reboot the system.

Any idea how i can fix this problem ?
 
Old 10-29-2014, 06:58 PM   #2
slayerking
Member
 
Registered: Apr 2011
Posts: 60

Original Poster
Rep: Reputation: 3
bump!!

Anyone can help plz?
 
Old 10-29-2014, 07:06 PM   #3
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
Why are you running XAMPP rather than a normal, everyday LAMP stack? Since you are running Linux, you can just install Apache, MySQL, PHP, and Perl and have the same thing, without the hacks involved with trying to get XAMPP to work like LAMP.

Here is information on doing that:
http://straightedgelinux.com/blog/howto/lamp.html
or in audio form:
http://hackerpublicradio.org/eps.php?id=1601


As for your specific question, it sounds as if maybe XAMPP is getting started before your computer has all of its networking sorted out. I do not know why that would be; I do not know how XAMPP configures itself. Maybe you could either set XAMPP to either start only after resolv.conf is fully populated (that's sort of my working theory as to why XAMPP would not be able to find an external host) or only after you have a DHCP lease, or something like that.

I am assuming that you can ping external hosts, even though XAMPP cannot?
 
Old 10-30-2014, 01:43 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
You haven't mentioned your distribution.
Put the restart command in start up application.
Code:
/opt/lampp/lampp restart
or
Code:
/opt/lampp/lampp start && /opt/lampp/lampp restart
It start and restart after login automatically. You do not need to do it manually.
 
Old 10-30-2014, 08:35 AM   #5
slayerking
Member
 
Registered: Apr 2011
Posts: 60

Original Poster
Rep: Reputation: 3
Thanks for the reply guys !!

well,the chained restart may work but I guess its not the right solution to it.
yes i understand that the xampp server is started a bit ahead that the dhcp lease. Looking at rc.d directories the network activity is starting at runlevel 2.

So a genric question would be how can i start any program at runlevel 2 or 3 as a root automatically ?
Also how can we archive a delayed start like run
Quote:
/opt/lampp/lampp start
after 5 sec ?
My distribution is mandriva Hydrogen. yes, its a old but my hardware is not brand new either.It working good for me..

Last edited by slayerking; 10-30-2014 at 08:43 AM.
 
Old 10-30-2014, 10:20 AM   #6
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Give a sleep of 5 seconds ahead of your desired command.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
about the db in xampp byran cheung Linux - Newbie 5 04-28-2014 06:30 AM
XAMPP 1.7.7 - XAMPP: Couldn't start MySQL sonic656 Linux - Software 2 10-09-2011 01:43 PM
KDE 4 Autostart Program Bash Script to Write Autostart Bash Scripts for You! jdmcdaniel3 SUSE / openSUSE 1 05-03-2010 07:17 AM
tomboy autostart in xfce, though not on autostart list zlya Linux - Desktop 2 11-10-2009 11:49 AM
xampp charnel Programming 0 07-15-2005 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:57 PM.

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