I've set up a project called testphp in Netbeans PHP. It has one file called Index.php. I've added to the html and have tried both run and debug.
I receive the following message from Firefox:
(URL:
http://localhost/TestPHP/index.php?XDEBUG_SESSION_START=netbeans-xdebug)
Not Found: The requested URL /TestPHP/index.php was not found on this
server. http://localhost returns "It Works!"
The virtual directory "TestPHP" does not appear to exist either. Can
someone suggest some pointers for tracking down the problem?
Ubuntu : 10.10 Apache : 2.2.16 (Ubuntu) PHP : PHP 5.3.3-1ubuntu9.3
with Suhosin-Patch Copyright (c) 1997-2009 The PHP Group Zend Engine
v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
Your project isn't actually being served by your local server. The "It Works!" output is a default page your server is outputting because there are no actual files for it to serve.
The NetBeans "Local Web Site" project configuration assumes that your PHP sources will be stored in your local server's Web documents directory.
If you look at the NetBeans docs, you'll see there's an option to make NetBeans automatically copy your project's files to the appropriate web server directory when you "Run" your project.
Related
I am running OSX El Capitan (version 10.11.6).
I had php 5.5 installed.
Phpunit requires php5.6 and more so I tried to upgrade my php to 5.6. I couldn't do it so I gave php7 a try.
I followed these guides:
https://coolestguidesontheplanet.com/upgrade-php-on-osx/
https://php-osx.liip.ch/
Mac upgraded PHP to 5.6, but CLI php -v get 5.3.28?
My current output with php -v is :
PHP 7.0.12 (cli) (built: Nov 1 2016 10:21:11) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
Funny thing, my output with a phpinfo(); when called from somewhere inside a Symfony project, is still PHP Version 5.5.36
Any ideas??
Terminal uses a different PHP than a HTTP server in browser. You can check what PHP you're using in CLI (command line interface) by this terminal command:
$ which php
I don't know if you use any AMP stack (like MAMP). They include their own PHP, so you need to update them in order to have a different PHP version in browser.
Maybe you can use this trick to determine what PHP versions you use in browser / CLI: Find the php.ini path in your phpinfo() output and compare it with this terminal command:
$ php -i | grep php.ini
It's always a good idea to use the debug URL to troubleshoot your Symfony projects; to use this, simply append:
app_dev.php
For example if your route was like http://myhome/, then you would use:
http://myhome/app_dev.php
Then on the bottom of your browser you will have the Symfony debug bar. In the bottom right corner, the version of Symofny is shown, an if you move your mouse over it, you will see the version of PHP; plus also a link to "View phpinfo()". You can click on it to view the full PHP information, including where the PHP file is located.
The PHP config file used (shown on the phpinfo() page) is shown by:
Loaded Configuration File
Hope that helps!
In my terminal put that command
# php -v
i am getting
PHP 5.6.23-2+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
but in my localhost phpinfo();
i am getting 5.5.9
PHP Version 5.5.9-1ubuntu4.14
how can i got 5.6 in locahost phpinfo();
i am using localhost wamp server in ubundu os..
The PHP application and the Apache server will load different php.ini files,
wamp provides one in the apache directory and php itself will use the one in it's own php directory (where the apps are located)
To check that, you can do php -i | grep php.ini and compare it to the loaded Configuration File you get from your browser when using phpinfo()
To work around this issue, either install LAMP yourself, or try to link the two files together somehow.
Reference to another Stack Overflow question on the same topic
I have a Vagrant/VirtualBox machine configured with ubuntu/trusty32 box.
I manually installed PHP 5.2 in the Vagrant box.
In PhpStorm EAP, when configuring remote PHP Interpreter, using Vagrant option (instead of SSH Credentials), PhpStorm can connect to Vagrant box (Vagrant Host URL field has the link to Vagrant box in blue and when I click on link, I get the successful message popped up).
Right below, at General section, PHP executable field, I select the PHP executable in my Vagrant box, but I get the message
PHP version: Not installed
The PHP info page is ok, including with xdebug info. The system is running well. The only thing is that I can't debug with xdebug.
Why I can connect with Vagrant box, but PhpStorm does not recognize the version of remote PHP?
UPDATE:
1) php.ini configuration for xdebug in php.ini:
zend_extension=/opt/php-5.2.17/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
xdebug.remote_enable=true
xdebug.profiler_enable=true
xdebug.remote_host=192.168.1.40
2) output for /opt/php-5.2.17/bin/php --version:
PHP 5.2.17 (cli) (built: Jun 29 2015 17:50:55)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
I have an CodeIgniter project, everything was fine when I worked on my local machine.
When I have uploaded the project to server suddenly controllers stopped working except the default controller. I have burned a few hours of searching the problem and have found that my controllers and models does not works because their file name was not with capital letter.
Example:
controllers/test.php - does not works
controllers/Test.php - works
The same is with models, I think that it is configuration issue of apache or something.
I have :
Ubuntu 14.04
Server version: Apache/2.4.7 (Ubuntu)
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
Any ideas?
It's not a configuration issue. It's not an issue at all - just how most Linux file systems work.
Under Windows, and depending on an install-time configuration, on Mac OSX too, there's no distinction between 'test.php' and 'Test.php' - it's the same file.
With UNIX-style file systems on the other hand, you can have both 'test.php' and 'Test.php' in the same directory.
It might've worked for you under CentOS and Debian in the past, but that's because you've used older versions of CodeIgniter, which used to look for all-lowercase file names.
CodeIgniter 3.0-dev, which you are using now, requires that all class filenames start with a capital letter. This is explained in the upgrade instructions.
I have a situation in the office. For development, i have been using the built-in web server that comes with PHP 5.4.
My problem is, on my local machine, it works like a charm but on the staging server, request uri length becomes a problem.
Staging server is: Ubuntu 12.10 32 bit.
PHP Version is
PHP 5.4.14-1~quantal+1 (cli) (built: Apr 11 2013 16:59:23)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
php.ini files are the same with the ones in my local.
I tried to recompile the PHP but still no luck. I have a simple php code to test as;
<?php
echo $_GET['q'];
?>
but when the request is too big (around 1447 chars like index.php?q=blahblah...) Built-in web server fails and just gets ....endofstring as request. So returns a 404.
I Know that every web server has a request url length limit, but while an identical request to my localhost (ubuntu 12.04, again php built-in server) works, there should be something that i miss.
Any suggestions or clues where to look for the problem?