How to configure FlashDevelop to debug in web browser? - php

I'm following directions to set up a debugging in FlashDevelop in web browser. I'm getting confused on 'Configure your project' step. It says:
Open the Project properties and change the "Test Movie" option to
"Open Document...". Click on the button which should appear,
and enter bin/index.html (path to html page, relative to project root)
in the prompt.
What is the bin/index.html file? Is it where my SWF is loaded? I currently have a SWF that loads from a PHP page. So I pointed it to my PHP project's index.php page build project. After build I get a generic Windows message that Windows cannot open the file with that extension.
Is it possible for me to debug my SWF from my PHP page which loads it?

I don't have experience directly with what you're talking about, but I guess you have to point to a PHP file which is running in a webserver. Otherwise it can't be interpreted and run.
If you are running locally, you can use xampp, put your things in htdocs, and use localhost url to reference the file: http://localhost/projectname/index.php

Related

How to configure local PHP to show directory content

I have a local version of Windows php to test my webpage. I run it using php.exe. It has a built-in webserver so pages can be accessed from a browser through localhost:/path.
If I enter an URL pointing to a file it opens that file in browser. I would like to configure it so that it shows the content of a directory if URL points to a directory. E.g. after inserting URL http://localhost:1234/foo/bar/ into the browser I would want to see the files in the bar directory listed in the browser. Similarly how other webservers do it when configured so.
My local PHP returns 404 instead.
Is there any way how to achieve that for this built-in webserver in php.exe? How?
The built-in server is specifically for quick development and debugging as stated in the command line server doc and directory listing is one of the features is lacks. This answer provides an example for building yours though.

Need help getting PHP project to work on my wampserver [duplicate]

This question already has answers here:
Project Links do not work on Wamp Server
(13 answers)
Closed 3 years ago.
This is my first time trying to use wamp and I'm having trouble viewing my php project. I know the code works just fine (because it is a copy of currently live site). Basically when I try to view the site on my localhost only the index.php file loads and the image folder. No css folders/files are loading. The links work, so I can navigate my site, but no css.
My project folder is inside the www folder in my localhost. See below my project is called movies.
C:\wamp64\www\movies
When I go to view it at - http://localhost/movies/ , it displays only the html. When I view the sources tab in the console it shows the localhost/movies and inside movies an image folder and index, there should be many other folders including CSS and PHP folder called process.
If you saved the Webpage by CTRL+S the sources to your wamp dir then maybe it didn't download all sources.
I suppose you are using Windows and maybe chrome or firefox. Inspect Element the page you are currently trying to view and find sources .CSS|.JS|.JPG in console then navigate to the file and see if it's working like http:/localhost/assets/js/something.css.
Remember all your files should be inside www folder because it is the root dir accessible for server.
If you are using <? (short open tag) then for Wamp, Left click on wamp, Hover on PHP then hover over PHP Settings, find "short open tag" and finally Click it. Restart Wamp Server.
The reason for this might be due to the links. If your website is example.com and you link to an image /directory/file.jpg, the browser will request domain+uri -> example.com/directory/file.jpg and it works fine.
You run in a directory called movies and you access it via localhost/movies/. You expect that the browser used localhost/movies/directory/file.jpg, but it's not. It's domain+uri -> localhost/directory/file.jpg. As you can see, "/movies" is missing from it, thus it's not finding the file.
There are a few possible solutions. The best one is to add alocal test domain in your vhost file. You can do this by clicking the wamp logo -> 'your virtual hosts' -> 'virtual host management'. This solution is a bit more difficult and might require some more research, but is the long term best solution.
The first input is your website, eg movies.test.
The second is the path, which is c:/wamp64/www/movies/ (or where-ever you have wamp).
Then click start and restart wamp.
You can also set a base path in you html header.
<base href="/localhost/movies" >
And you could also link to your files relative
<img src="./images/file.jpg" />
These last two are easier, but require different values local vs on your production server. That works annoyingly if you have to keep updating it.

Eclipse Neon php XDebug form action=post in WordPress

Objective: debug a php script triggered from an HTML form with action=POST from within a WordPress Page.
What works: I can initiate a debugging session for index.php. This results in the web page displaying in the browser view. I can then click on any links on the page, which in turn triggers a new call to index.php. I can step through the WordPress code with no problems, set breakpoints and so on.
The apache server is on my workstation, localhost, running Ubuntu Linux.
In one page there is a form. When I click the submit button, I get a message in the browser view saying:
Unable to load page
Problem occurred while loading the URL file:///xyz.php
Error opening file: No such file or directory
It seemed to me that Eclipse is looking for the php file at the workstation root directory instead of the server root. So I put a symbolic link at the root level to the php script to see if Eclipse would find it.
Now when I click on the link I get a File Dialogue asking me do I want to download the php script.
It seems there must be a wrong setting somewhere but I am at a loss. As it stands I can only debug code that is triggered by a GET, not a POST.
If I run the script in Eclipse without debugging, I can post the data and the post script executes. It is only with the debugger that I get the file not found error, so it seems to be in the debugging config:
Server Name: Nip.yt
Base URL: http://nip.yt (127.0.0.1 - works fine in browser)
Document Root: /home/peter/Documents/localhost/html/nip
Path Mapping
Path on Server: /home/peter/Documents/localhost/html/nip
Path in Workspace: /nip
I have tried replacing Path on Server with / with identical results.
Any and all advice appreciated.
EDIT:
I am now using php5.6 with Zend Debugger, but exactly the same thing happens.
Hanging his head rather sheepishly, he says...
I solved the problem. I just put the full URL in the
Doh...
Why didn't I think of that sooner???

netbeans 8 does not refer to the actual PHP file path, when running a PHP file

I have installed php, mysql and nginx properly.
I am able to run the PHP pages from Eclipse, i.e Eclipse opens up chrome, and pages are displayed correctly.
I imported my existing PHP project into Netbeans.
When I try to run any of the php pages, netbeans opens up chrome, but the web address is always the same, and not the real path of the PHP file.
Why netbeans refers to the same location, instead of trying to run the file from its real path? how can I fix it?
Thanks,
Qwerty
I found the solution.
The green "play" button in Netbeans does not run the current file, but runs the PROJECT! This caused eclipse to run the project path instead of the current file location!
Therefore, in order to run the current file click on "Run -> Run File" (Shift +F6), and then it works.
Just make sure that the project path is set properly in "Run->Set Project Configuration -> Customize", and then set the project URL to:
http://localhost/
That`s it!
Thanks,
Qwerty

Local PHP file won't open in Firefox

When I right click my local PHP file and select "open with Firefox" Firefox gets the focus for a second, but then the file opens in Dreamweaver instead. The same happens when I drag the file onto Firefox, or enter the URL ("file:///...") manually, or expressly select Firefox as the default application for PHP files. How can I get Firefox to show the file?
Firefox is not capable of handling PHP files, therefore it delegates their handling to a program that can do so (in your case, this is Dreamweaver).
PHP files should be served by a web server to the client (Firefox), which will display you the rendered content (probably HTML). PHP files are rendered by the PHP interpreter and then they are served using the HTTP protocol to a client as a web resource. So actually, you never open a PHP file with a browser, you just consume the HTTP resource that corresponds to the rendered output of that file.
Firefox can show .html-files. You have to install a webserver (xampp) to interprete .php-files. When xampp is installed, start xampp-control-panel, open your browser and (in case ur file is "test.php" in "c:\xampp\htdocs\test.php") and type http://localhost/test.php.
But first, right-click any php-file->Open with...->choose program, then select Firefox in the list.
You must install a local web server like xamp, wamp or easyphp.
Then you locate your files in that's www directory and see your file in browser with path:
localhost/myphp.php
Have a good time.
I have this solution to open a php on linux :
php -S localhost:8000
and open a firefox and go to the page :
http://localhost:8000/index.php
It works well for me.
The quickest way is to rename localhost/yourfile.php onto localhost/yourfile.html. (Tested on loop's Ubuntu 16.04 LTS)
You should deactivate adblock for localhost (or your domain), it should runs.
ABP icon -> click on deactivate on localhost -> F5

Categories