LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Error in php when executing with netbeans (https://www.linuxquestions.org/questions/fedora-35/error-in-php-when-executing-with-netbeans-4175492583/)

mr.cracker 01-25-2014 10:57 PM

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?

j-ray 01-26-2014 08:53 AM

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.

angryfirelord 01-26-2014 09:26 AM

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

mr.cracker 01-31-2014 08:34 AM

[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.

j-ray 01-31-2014 09:35 AM

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

mr.cracker 01-31-2014 12:18 PM

Quote:

Originally Posted by j-ray (Post 5108708)
If you type
/usr/sbin/apache2ctl configtest

i got following error!

bash: /usr/bin/apache2ctl: No such file or directory

j-ray 01-31-2014 04:14 PM

on my box it is in
/usr/sbin
you search in /usr/bin

mr.cracker 02-01-2014 01:10 AM

Quote:

Originally Posted by j-ray (Post 5108952)
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

j-ray 02-01-2014 04:49 AM

what does the error log say?

mr.cracker 02-03-2014 09:44 AM

Quote:

Originally Posted by j-ray (Post 5109162)
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.


All times are GMT -5. The time now is 03:23 PM.