I have installed WAMP and enable some extension. After that i have installed eclipse for php. now my question how can i let eclipse now that i should use apache installation and the version of php which came with WAMP.
I will be developing web apps on windows.
Open Eclipse's preferences. In the menu on the left, navigate to PHP -> PHP Executables. Click the Add button. Under executable path, put the path to the php executable. With a new installation of WAMP, the path is C:\wamp\bin\php\php5.3.0\php.exe. Click "Finish".
For the server component, navigate to PHP -> PHP Servers in the preferences screen. If "Default PHP Web Server" does not exist or does not point to http://localhost/, click "New" and fill it in.
Take note of the "Path Mapping" tab of each server (accessible by selecting an existing server and pressing "Edit"). This lets you map a local path in your eclipse workspace to specific sub-urls of WAMP. This is useful if you deploy apps into your WAMP installation using VirtualHosts that have separate DocumentRoots.
Related
When I download XAMPP, the installation wizard doesn't give me the opportunity to download any of the programs (apache, MySQL, etc.) as services. So then when I open the XAMPP control panel, I am not able to check any of the service boxes.Please help, I have no idea why this is happening!Thanks
When you download XAMPP, those services should be what you are actually downloading - no need to select anything else.
When you open the XAMPP control panel, have you tried clicking "start" to the right of the programs?
I assume you installed Xampp correctly.
goto Xampp installation directory
Path : C:\xampp
Click to xampp-control.exe(Showed in image)
Open that. Then you find this kind of window
Click Starton Apache and MySQL front of there names
I have a webapp (PHP site using CodeIgniter) hosted on Azure. I have a situation where I want to use the pthread module. Since pthread is not available in PHP out of the box, when I install it using Xampp server, I suspect that it won't be possible to use threading on Azure.
But I am not sure. Azure documentation also doesn't talk about it. Is there a way I can use it pthread on Azure?
I am able to use it on my local Windows machine, using pthread.dll.
To enable extension in Azure Web APP, we should customize PHP runtime on Azure. Please refer to official site.
For this issue,I have tried to install pthreads successfully. And I toke those steps as following:
1, I obtained a PHP 5.4 (5.4.43) VC9 x86 Thread Safe package from PHP site explored to folder named PHP. And followed the pthreads site, got the lasted version of pthreads.
2,Added pthreadVC2.dll (included with the Windows releases) to the same directory as php.exe and added php_pthreads.dll to PHP extention folder.
3,I uesd phpinfo() to find default php.ini file in Azure, which should be similar with the picture:
,
Then I browsed Kudu Console of my web app via https://<your_web_app_name>.scm.azurewebsites.net/DebugConsole/?shell=powershell.
Locate to the directory found above. Download the content to local saved as php.ini in the PHP directory. Uncommented extension_dir = "ext" in this file.
4, Add a bin directory to your root directory (for example, bin\php), and use FTP tool to upload the PHP runtime on it.
5,Browse to the web app in the Azure Portal and click the configure tab.
Add *.php to the Extension field and add the path to the php-cgi.exe executable at the Handler mappings section.
At last, we check the PHP env,we should see the result as below
and run the test code of pthreads to check the extension
If you have any concern, please feel free to let me know.
I am very new to web development and I have decided to learn the ropes of php with mysql. I am currently taking an online course from Lynda.com teaching me on concepts of php and mysql.
I have installed the WAMP server on windows 2008 box and I can start all the apache services and when I go to http://localhost it opens up the WAMP webpage and when I click on phpinfo() it takes me to my php page showing me the version (5.5.12)
I have also configured IIS using this link but no luck when I open my php file I get the source code display in my internet explorer with all the html formatting. Its just a simple "hello world" file and the file extension is *.php
Ok, I think I know where I was going wrong.. I had created folder on my desktop and then saved the php file in it and was browsing to that file from IE.
What I need to do is browse using http://localhost... so I placed the same file in the www folder under the WAMP directory and then did http://localhost/helloworld.php and it opened up!
But there should be away I can use files from my desktop instead of placing the files in the www folder...
I was used eclipse as my ide and I have test.php. I want to run and debug that php script in eclipse. How I do it ?
You can run PHP scripts without a web server. PHP doesn't have anything to do with web servers.
You need to download PHP, of course. And then you can configure Eclipse to run your scripts in the command line. See
http://www.php.net/manual/en/features.commandline.usage.php
for command line usage of PHP
You can turn your computer into a webserver very easily with xampp.
http://www.apachefriends.org/en/xampp.html
So, you need to setup local webserver and run it.
for example Denwer (type you name and , mail for download) - this is build of appach server for local develop. (P.S. try to find there on your lang.)
By default Denwer setups to the C:\WebServers\
And yor site should be in C:\WebServers\home\sitename.ru\www
Then you should run servise and type in browser smt like sitename.ru
And Denwer setup MySql DB on you system
Microsoft Windows 7, Eclipse Mars.2 (4.5.2), PHP 7.0.4 (stand-alone install in C:\php), Eclipse PDT for PHP extension 3.7.0
Current Eclipse documentation is not clear, but newer PHP versions have the PHP -S option, to run a simple web server test environment. I succeeded with the following setup, and note this allows for a top-level/root URL to your project. Eclipse wants to use your Workspace folder as the web root, so if using subfolders in your URL is acceptable, then configuration is easier.
In Eclipse:
1. Run > External Tools Configuration
Create a new Program.
Location: C:\php\php.exe (your PHP installation)
Working Directory: ${workspace_loc:/myproject} (your project folder)
Arguments: -S localhost:8080 (change as desired)
On the Common tab at the bottom, almost hidden, there is a "Launch in background" option that is checked by default. Unchecking this did not work for me, so remember that Eclipse will launch a PHP processes in the background, so check Windows Task Manager.
Run this External Program to start the PHP web server.
In a web browser
2. Verify you can open your projects default page in a web browser.
Example: http://localhost:8080/
In Eclipse
3. Run > Run Configurations
Create new PHP Web Application. Name configuration, e.g. myproject-config.
Create a new Server. Name server, e.g. myproject-server.
Base URL: http://localhost:8000 (Match your PHP web server setting)
Leave all other Server settings blank.
Back on the Configuration, you must select a file, e.g. /index.php.
URL: Uncheck Auto Generate
URL: Make file name/path match above, and you can add parameters.
Apply your changes.
Test
Now you can select Run, or in the PHP Explorer you can select your project or default file and click the Run toolbar button.
Note that you will need separate Configurations for each PHP file.
Maybe not the easiest or greatest solution, but it allows you to stay in Eclipse.
I have my 1and1 hosted web site. I've got server-side php I need to debug.
All I've found mentions running/installing xdebug when you have a local web server
with php and mysql on a local web server.
However, I'm using the remote web server hosted at 1and1 hosting.
I'm using and loving netbeans, wow great IDE.
Anyways, how (if it's even possible) can I install then use the xdebug
debugger to debug my php code running at 1and1 from within Netbeans?
I'm wondering if it is my hosting company (1and1) that has to have xdebug installed.
I'm running the latest version of Netbeans but when I press the debug button on
the toolbar I see an error message popup that says
"There is no connection from xdebug detected within 40 seconds. The reasons could be that xdebug is neither installed nor properly configured. Be sure that your php.ini file contains these entries:
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost (or hostname)
xdebug.remote_port=9000
So I searched my harddisk, and despite having installed the full Netbeans
IDE, I have no php.ini file.
So can I make xdebug work remotely, ie. can I debug my php code as it runs on the
remote 1and1 web server, using Netbeans and xdebug?
I've only been using Netbeans for 2 days and for all I know, xdebug is not even a part
of Netbeans. Reason I say that is, I can 'run' my php remotely just fine -- it executes on the remote 1and1 web server when I push 'run' inside Netbeans -- and then the client side output on my local machine is correct. But I cannot step into the code with xdebug by pressing the 'Debug' button on the Netbeans toolbar -- is it possible xdebug did not get installed correctly with Netbeans?
xdebug should be installed inside the php folder and of course the php folder is located on the server where php is installed... at your hosting provider.
I would not expect an hosting provider to install xDebug as it seems to me it would be a huge security hole.
xDebug is not part of Netbeans and it is not part of PHP by default.
Now, looking at things on a more positive viewpoint, if you are going to develop PHP, you NEED a local server. It's very unprofessional to develop code directly on the live server.
Grab a copy of xampp and install it on your computer. Grab a copy of xdebug and install it following the instructions. Restart Apache. There, now you have a testing server.
Once you have a complete set-up on your computer, copy your PHP application's folder inside the "htdoc" folder.
NOW, and only now, should you consider developing in PHP. Develop locally, on your own testing server, xdebug will work whenever you start a debugging session from inside Netbeans.
When everything works, upload your files on your hosted space.