LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 01-25-2014, 11:57 PM   #1
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Rep: Reputation: Disabled
Question Error in php when executing with netbeans


am using FEDORA 20.
\MYSQL(MARIADB-SERVER),PHP,APACHE ALL INSTALLED AND WORKING. I have just successfully tested a project in php. my localhost is-> /var/www/html/.

Then I created a new PHP project in /home/NetBeansProjects/PhpProject1, using netbeans but it doesńt run.

When I try to run the project, i get The requested URL /PhpProject1/index.php was not found on this server on "http://localhost/PhpProject1/index.php"

since /var/www/html is not writable without root privilage, how can i change my localhost to netbeans default directory( /home/NetBeansProjects/ )?

OR WITHOUT CHANGE TO NETBEANS DIRECTORY ANY OTHER SOLUTION?
 
Old 01-26-2014, 09:53 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,455

Rep: Reputation: 104Reputation: 104
If there is nothing else in the /var/www/html you can remove it and replace it with a symlink to your project directory
(as root)
rm -r /var/www/html
ln -s /home/NetBeansProjects /var/www/html

Or edit your webserver's config.
If that is an apache2 then it might be /etc/apache2/httpd.conf. Search and replace the directories in the tag
DocumentRoot and the <Directory> tag below that. Then restart the server.
 
Old 01-26-2014, 10:26 AM   #3
angryfirelord
Member
 
Registered: Dec 2005
Posts: 502

Rep: Reputation: 60
Netbeans probably isn't set up to use the correct path. Verify your project's settings. You can make a local version of your site if you want to.

https://netbeans.org/kb/docs/php/project-setup.html
 
Old 01-31-2014, 09:34 AM   #4
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Original Poster
Rep: Reputation: Disabled
[QUOTE=j-ray;5105499]If there is nothing else in the /var/www/html you can remove it and replace it with a symlink to your project directory
(as root)
rm -r /var/www/html
ln -s /home/NetBeansProjects /var/www/html
QUOTE]

now when i did following command i got error,
service httpd start

Redirecting to /bin/systemctl start httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
 
Old 01-31-2014, 10:35 AM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,455

Rep: Reputation: 104Reputation: 104
My guess is that apache does not allow the DocumentRoot to be a symlink. But I am guessing only. If this was the case you could add a +FollowSymLinks to the <Directory>-tag in the conf file. (the directory tag regarding the docroot directory)

If you type
/usr/sbin/apache2ctl configtest
it may give you out what's wrong. Or consult the error logs, probably under /var/log/apache2/error.log

Last edited by j-ray; 01-31-2014 at 10:39 AM.
 
Old 01-31-2014, 01:18 PM   #6
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by j-ray View Post
If you type
/usr/sbin/apache2ctl configtest
i got following error!

bash: /usr/bin/apache2ctl: No such file or directory
 
Old 01-31-2014, 05:14 PM   #7
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,455

Rep: Reputation: 104Reputation: 104
on my box it is in
/usr/sbin
you search in /usr/bin
 
Old 02-01-2014, 02:10 AM   #8
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by j-ray View Post
on my box it is in
/usr/sbin
you search in /usr/bin
I tried sbin also but same error..am u ing fedora 20
 
Old 02-01-2014, 05:49 AM   #9
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,455

Rep: Reputation: 104Reputation: 104
what does the error log say?
 
Old 02-03-2014, 10:44 AM   #10
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by j-ray View Post
what does the error log say?
/usr/sbin/apache2ctl configtest
bash: /usr/sbin/apache2ctl: No such file or directory

[root@localhost mr]# /var/log/apache2/error.log
bash: /var/log/apache2/error.log: No such file or directory

[root@localhost mr]# cat /var/log/apache2/error.log
cat: /var/log/apache2/error.log: No such file or directory


[root@localhost mr]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: failed (Result: exit-code) since Mon 2014-02-03 21:10:00 IST; 3min 21s ago
Process: 3851 ExecStop=/bin/kill -WINCH $MAINPID (code=exited, status=1/FAILURE)
Process: 3849 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 3849 (code=exited, status=1/FAILURE)

Feb 03 21:10:00 localhost.localdomain kill[3851]: -q, --queue <sig> use ...
Feb 03 21:10:00 localhost.localdomain kill[3851]: -p, --pid prin...
Feb 03 21:10:00 localhost.localdomain kill[3851]: -l, --list [=<signal>] list...
Feb 03 21:10:00 localhost.localdomain kill[3851]: -L, --table list...
Feb 03 21:10:00 localhost.localdomain kill[3851]: -h, --help display this...
Feb 03 21:10:00 localhost.localdomain kill[3851]: -V, --version output versi...
Feb 03 21:10:00 localhost.localdomain kill[3851]: For more details see kill(1).
Feb 03 21:10:00 localhost.localdomain systemd[1]: httpd.service: control proc...
Feb 03 21:10:00 localhost.localdomain systemd[1]: Failed to start The Apache ...
Feb 03 21:10:00 localhost.localdomain systemd[1]: Unit httpd.service entered ...
Hint: Some lines were ellipsized, use -l to show in full.
 
  


Reply

Tags
netbeans, php5 apache mysql


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
PHP Netbeans aarsh Linux - Newbie 5 08-13-2011 04:30 PM
Netbeans PhP : scrambled text jonaskellens Linux - Software 1 08-10-2011 06:16 AM
problem with netbeans after executing iptables commands vicky43 Linux - Newbie 1 03-14-2011 06:05 PM
installing netbeans-6.9-ml-php-linux.sh moiseszaragoza Ubuntu 1 08-07-2010 11:57 PM
Executing PHP script- error message vfulco Linux - Newbie 3 07-13-2004 11:55 PM


All times are GMT -5. The time now is 07:57 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration