Questions tagged [php]

PHP is a widely-used general-purpose scripting language that is especially suited for Web development. Questions about programming in PHP are off-topic and should be asked on Stack Overflow.

PHP is often paired with the MySQL relational database. PHP also includes great database support for PostgreSQL, SQLite, Microsoft SQL Server (API ref), Oracle, IBM DB2 & Cloudscape, Apache Derby and even ODBC. All modern versions of PHP include PDO, a built-in data-access abstraction library with comprehensive connectivity options.

1978 questions
106
votes
4 answers

Checking what PHP version I'm running on Linux?

I'm running Centos 5 and I need to know what version of PHP I'm running, is there a command for this which I can run?
Elitmiar
  • 3,084
  • 12
  • 40
  • 46
64
votes
2 answers

The MD5 hash value is different from Bash and PHP

I tried to generate the MD5 sum (using md5sum) of a string, "hello". I tried out different methods as the md5sum tool in Linux, PHP's MD5() function as well as various online text to md5sum translators. echo "hello" | md5sum and echo "hello" > file…
Himanshu Shekhar
  • 820
  • 1
  • 7
  • 11
62
votes
7 answers

How do I rename a file to .htaccess in Windows 7?

I'm using XAMPP to test a PHP script. Now, in the root of the folder I want to place a .htaccess file according to the requirements of the script. But Windows won't let me rename it to .htaccess. Is there any way to go around it? I'm using Windows…
rzlines
  • 7,488
  • 17
  • 65
  • 90
62
votes
5 answers

What does an `output is not a tty` error mean?

I tried to write the output of the command php -i to the a file using php -i > info and received the following error: output is not a tty What does it mean? I'm using git bash on Windows.
Max Koretskyi
  • 733
  • 1
  • 5
  • 10
53
votes
2 answers

How to manually install Apache, PHP and MySQL on Windows?

How do I install Apache with PHP support and the MySQL server on Windows without using any ready-to-use packages like WAMPServer or XAMPP ?
user256743
42
votes
3 answers

How to install an updated version of PEAR / PHPUnit on Ubuntu?

Most tutorials online show how to install PEAR by doing this: sudo apt-get install php-pear This installs version 1.6.1. It works great because it's super easy! My problem is that I want to install PHPUnit and it requires PEAR version 1.8.1 so my…
Andrew
  • 14,554
  • 30
  • 70
  • 82
33
votes
3 answers

Why is the PHP version different in phpinfo() and CLI?

I realized that there is a miss matching between the PHP version reported by phpinfo() and php -v (in the CLI). phpinfo(): 5.5.24 php -v: 5.6.9 I am working on a Mac OS X 10.10 (Yosemite) and installed a library (php-version) to try to manage the…
33
votes
10 answers

How do I easily highlight the syntax of PHP code in Word?

How do I easily write and syntax-highlighted PHP code (or any others programming language) in a Word 2009 document?
Christian Studer
  • 464
  • 1
  • 5
  • 11
32
votes
7 answers

phpinfo() and php -v shows different version of PHP

I wanted to know which php version I am using so I wrote the standard script: phpinfo(); Which gives me PHP version 5.6.10 The correct PHP version needed for my application. When I tried in terminal: php -i or php -v It shows me: PHP version…
Gabf Hann
  • 423
  • 1
  • 4
  • 5
28
votes
5 answers

php.net listed as suspicious - visiting this web site may harm your computer

When I access php.net through Google search i get the following message saying The Website Ahead Contains Malware! See the screenshot attached below: Is it same for you guys? How can I avoid this? Does this mean the site has been hacked or…
onefourone14
  • 629
  • 2
  • 8
  • 15
28
votes
4 answers

How to add new PHP version to WAMP

I'm trying to install PHP 5.3.8 to work with WAMP (Windows). I downloaded it from the PHP website, copied it in the bin folder, and added this line to wampmanager.ini: Type: item; Caption: "5.3.8"; Action: multi;…
Alex
  • 899
  • 5
  • 20
  • 32
24
votes
5 answers

How to install the SQLite PDO extension on Ubuntu

The default Ubuntu PHP package does not include the PDO SQLite extension. How can I install the SQLite PDO extension? Is there a package that one can easily install via apt-get?
wowpatrick
  • 4,199
  • 7
  • 31
  • 40
24
votes
6 answers

Is there any *good* HTML-mode for emacs?

I love emacs, and I want to do my web-programming work in it, but I can't find a way to get it to edit HTML properly. I mean it's seriously awful. It will do HTML fine, but not PHP, javascript, etc. I tried getting html-helper-mode... I downloaded…
Carson Myers
  • 3,061
  • 5
  • 23
  • 23
23
votes
2 answers

Where is the PHP log file located on Mac OSX?

I am having issues with phpMyAdmin on my Mac. I cannot seem to connect to the local MySQL server. When I try to log in I get the following message Cannot start session without errors, please check errors given in your PHP and/or webserver log file…
David
  • 2,257
  • 8
  • 25
  • 26
19
votes
5 answers

How to restart PHP on Windows? Unable to find the socket transport "ssl"

I am trying to load the openssl module, I uncommented it in the php.ini: extension=php_openssl.dll But when running my script I get an error: Failed to connect: 0 Unable to find the socket transport "ssl" - did you forget to enable it when you…
meda
  • 571
  • 4
  • 7
  • 18
1
2 3
99 100