I have created a simple hello world php app in eclipse with the name od FirstPHP
when i try to run it as "run as php web page"
it tries opening the page
http://localhost/FirstPhp/first.php
in eclipse web browser
and got the message web page not found
when i open http://localhost:8080/ it works fine , so tomcat is ok
Any Suggestion
AFAIK, Eclipse doesn't automagically configure your webserver so that its document root is suddenly wherever sits the project that you just so happen to currently be working on.
Configure your webserver to use the proper path as DocumentRoot.
I also notice that you used the wrong port number in the first instance.
Install your server correct. Why do you use Tomcat in the first place. Thats not primarily used for PHP, but for JSP.
Check if localhost:80 works fine too, thats where he wants to go...
Make sure you set the DocumentRoot in Eclipse.
Gr.
Related
I've installed in my remote server, via Softaculous, Laravel 8.
In order to access directly to the APP, just like when running php artisan serve in my local machine, in CPanel i defined the document root to the folder Laravel\public.
Everything works exactly as it should! I type the address (ex: myDomain.com) and the App runs perfectly...
However i don't want to being always typing php artisan serve while developing, so i tried to replicate the cpanel struture in my local machine.
To achive thar, i've created a virtualhost in XAMPP httpd-vhosts.conf pointing to the folder Laravel\public, and created the host file in windows system, like always.
When accessing the location in my local machine the first page renders perfectly, but as soon as i make a request for a new view, by example:
Route::get('/posts', function () {
return view('posts.index');
});
I get a "Not Found The requested URL was not found on this server" error! I'm sure is not a coding error because the same code runs flawlessly in remote server.
Which technique is used by cpanel to allow laravel to work directly from \public folder without necessity to initiate anything and how to replicate that in local development machine?
Well...
After much reading, backs and forwards, i believe this behavior depends on the way Apache its served by XAMPP.
So, the solution i adopted was change my local development tool to LARAGON.
Everything worked just fine with a lot of new features that donĀ“t exist in XAMPP.
I created a local WordPress site and in XAMPP set it up with Virtual Hosts so the address test-wp.dev was the home adress. All was working fine and then for some reason I decided to turn off apache, leave mysql on and try the build in server.
So I navigated to C:/xampp/htdocs/test/wordpress/ and ran php -S localhost:8080
It worked fine. However, today I went to go back to test-wp.dev using the Apache server and it keeps redirecting to localhost:8080. I don't want to use the built in server now. I want Apache.
Where do I "unbind this" or free up that port or whatever. I don't want to have to run the built in server for that folder anymore.
Thanks.
Windows 7
PHP 5.6
So, I Have REST URL to register like this :
http://localhost:8080/task_manager/v1/register
And then, I try the URL in Google Chrome Advanced Rest Client.
Everything goes smoothly.
And now I decided to test the URL on another computer.
So I copy paste the file to another computer and test the URL once again.
But the result is I got 404 ERROR, Object not found.
Did I hit something wrong ?
I copy all the file correctly.
This is weird.
UPDATE : I use all the folder which contains all the files and I using same version of XAMPP & PHP on that both computers
Localhost targets on your computer, means the actual machine the files are on. If you are using php > 5.3 you can use php's build in development server with
php -S __YOUR LOCAL IP__ : 8000
and access the site from all the computers within your network
For example, if you run
php -S 192.168.0.1:8000
on your development machine, you can access it via
http://192.168.0.1:8000/
from every device connected to your local network
As you have written in your comment you have copied all the files, it is most likely that you either don't have php, apache or a webserver (MAMP,WAMP,...) installed (or started) on the other machine, or you just didn't copy the files to the correct folder.
an url beginning with localhost refers to the computer where it's called from. See wikipedia localhost.
To provide the same behavior on another computer you need to copy the whole project and install the used server software e.g. apache, mysql etc. pp. or access the project from another computer in the same network using the internal network IP instead of localhost.
FYI: localhost is almost the same like the loop-IP 127.0.0.127
so on the computer where it works there should also work: http://127.0.0.127:8080/task_manager/v1/register
Now replace the 127.0.0.127 with the IP of your computer when testing it on another computer
You need to run your project on a webserver like your local.
I had the built-in webserver configured for my PhpStorm project, so that "Open in Browser" loaded the file via localhost. I then configured a remote host via SFTP so that I could test and sync things in the final environment, but now my "Open in Browser" opens the remote web address and I can't find how to open local copies now.
I tried creating a new "Remote host" with Type "Local or mounted folder" or "In place" and set the URL to http://localhost:63342/. The server is running, but I get 404 errors, even when manually navigation to http://localhost:63342/<projectname>/folder/file.php
Am I missing something stupid? Are there some docs for mixing local debugging and remote hosts?
Try unmarking your SFTP Deployment entry as Default for this project. With no default set the built-in server will be used by default.
but I get 404 errors, even when manually navigation to http://localhost:63342/<projectname>/folder/file.php
This should not be happening -- the built-in web server should be always available. At least I could not reproduce such issue when doing quick test locally in 8.0.2.
But if it's reproducible for you then I may only advise to submit new ticket to their Issue Tracker.
Following situ:
VMWare running on Win7
Debian, Apache, PHP and Squid running in VMWare
the website is located in the shared folder 'SF', so from
- debian-perspective: /mnt/hgfs/SF'
- windows-perspective: [...]/SF
my index.php is located in the sub-folder 'raffael'. So I am able to edit the website with Eclipse on Windows.
I can access index.php and properly execute it using Firefox and FoxyProxy through: http://raffael
My FoxyProxy-settings are:
IP: 192.168.0.128, Port:3128, Pattern: 'http://raffael*'
How do I have to configure Eclipse so that I can access the websie through the Eclipse-Browser instead of having to switch to Firefox all the time?
Thanks and happy new year!
Raffael
I don't think you need to make any changes to get the Eclipse browser to open a page; if another browser (such as firefox) can get to it, then so can your Eclipse browser. Just plug the same URL into your address bar and go.
Hope this helps.
You can tell Eclipse to use a proxy in Preferences -> General -> Network Connections. This is most likely a http proxy.
Could you explain why you need the http proxy? I do not immediately see a need to.