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.

Filter by
Sorted by
Tagged with
106 votes
4 answers
479k views

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's user avatar
  • 3,144
68 votes
5 answers
52k views

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's user avatar
65 votes
2 answers
42k views

The MD5 hash value is different from Bash and PHP [duplicate]

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 ...
Himanshu Shekhar's user avatar
62 votes
7 answers
90k views

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 ...
rzlines's user avatar
  • 7,538
53 votes
2 answers
153k views

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 ?
user avatar
42 votes
3 answers
75k views

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 ...
Andrew's user avatar
  • 14.9k
33 votes
10 answers
27k views

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's user avatar
33 votes
8 answers
120k views

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 ...
Gabf Hann's user avatar
  • 433
33 votes
3 answers
41k views

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 ...
Salvatore Dibenedetto's user avatar
28 votes
5 answers
3k views

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? ...
onefourone14's user avatar
28 votes
4 answers
114k views

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"; ...
Alex's user avatar
  • 989
25 votes
5 answers
113k views

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's user avatar
  • 4,389
25 votes
6 answers
14k views

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....
Carson Myers's user avatar
  • 3,101
23 votes
2 answers
71k views

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 ...
David's user avatar
  • 2,287
20 votes
5 answers
83k views

How to install PHP, Pear, PECL, and APC with Homebrew on Mac OS X?

I'm trying to install APC for PHP 5.3 in the easiest way possible. I love Homebrew so I started down that route. I was able to install PHP 5.3.6 with this command: brew install https://github.com/...
Andrew's user avatar
  • 14.9k
19 votes
5 answers
123k views

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 ...
meda's user avatar
  • 571
19 votes
5 answers
10k views

How to go to a website on a shared server by its ip address?

I have a few questions, please help: Fist, I can access Google search just by typing http://74.125.224.211, because this is the IP address returned by nslookup. However, I could not do so with the ...
user1502776's user avatar
18 votes
2 answers
99k views

How can I remove Apache2 that I have installed in Mac OS X?

A while ago I thought that it would be handy to install Apache2 on my MacBook and not go the easy route by just installing MAMP. However now I’ve changed my mind but I can’t simply delete Apache2. I’...
Gameshadow's user avatar
17 votes
1 answer
2k views

hexdump vs actual file contents

When I do hexdump filename.txt I get the following as output: 00000000 ac5a 5afb c08d 5d15 26d0 2491 e8c9 8917 00000010 When I do <?= bin2hex(file_get_contents('filename.txt')); ?> I get this:...
neubert's user avatar
  • 7,122
17 votes
5 answers
79k views

PHP script can't run bash script. sh: Permission denied

I'm trying to exec a .sh script from PHP, however it is not executing. I checked the error logs, and I'm getting the 'sh: Permission denied' error. I checked under which user php is being run, and ...
Robin Presto's user avatar
16 votes
1 answer
14k views

Proxy radar found in apache logs file

I was reading the logs of the apache server and I was shocked by seeing these logs! [Sun Oct 25 06:44:48.922248 2015] [mpm_prefork:notice] [pid 17635] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-...
iShaalan's user avatar
  • 293
16 votes
2 answers
2k views

High CPU usage running Symfony on PHP-CLI

I have a Dell laptop with Intel i7 5th generation running Windows 10 x64 and PHP 5.6.17 x86 environment. When I run a fresh installation of Symfony 3.0 using php-cli: php bin/console server:run In ...
Marcelo Rodrigo's user avatar
15 votes
4 answers
91k views

Where is the PHP executable on Ubuntu?

I have installed Apache and PHP. I know PHP works as I have tested a simple PHP file on an Apache server. I'm writing a simple webserver which should be able to process PHP files. So once I get a ...
samsamara's user avatar
  • 405
15 votes
5 answers
23k views

phpmyadmin symlinks error after ubuntu upgrade

After the upgrade of my ubuntu server to 13.04 my phpmyadmin is no longer reachable. the browser reports 500 (internal server error) and in the error.log it says: PHP Fatal error: require_once(): ...
mcnesium's user avatar
  • 551
15 votes
6 answers
20k views

Where can I find ready-to-use virtual machines? [closed]

I'm new to virtualization, and I'm trying to create a couple of boxes for testing the software I develop (php) in diferent enviroments. I know php is portable, but sometimes it breaks because of case-...
HappyDeveloper's user avatar
13 votes
7 answers
24k views

Apache client denied by server configuration after mac OS X upgrade to Yosemite

I know this looks similar to other questions but Yosemite seems to have changed something with Apache configuration with the upgrade. My error log says: "client denied by server configuration: /...
Doug Gardiner's user avatar
13 votes
7 answers
88k views

How can I completely remove PHPStorm, and all associated files on Ubuntu 13.04?

After removing the Phpstorm directory from Ubuntu, future installation attempts do not actually install any more - no menu item appears under Applications in the top left, and running the "globally ...
James's user avatar
  • 259
13 votes
3 answers
27k views

configure: error: Unable to locate gmp.h

Per https://stackoverflow.com/a/19894267/569976 I tried the following to no avail: ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h --with-gmp=/usr/include/x86_64-linux-gnu Both of them ...
neubert's user avatar
  • 7,122
13 votes
3 answers
26k views

ffmpeg command for concatenate two mp3 files

I am using ffmpeg for Concatenating two MP3 files together, I use this command : ffmpeg -y -i first.mp3 -i second.mp3 -filter_complex "[0:0][1:0] amix=inputs=2:duration=longest" -c:a libmp3lame ...
Karami's user avatar
  • 133
13 votes
4 answers
10k views

"Too many files open" on Mac OSX after running apache in PHP with XDebug for some time

I am running Mac OS X 10.9.4, including the builtin apache2 webserver with PHP 5.5.14 from brew (packages: php55, php55-intl, php55-pdo-pgsql, php55-xdebug). When running this setup it works quite ...
Daniel Rotter's user avatar
13 votes
2 answers
30k views

What is a stopped process in linux?

So I had some PHP scripts running from the command line, and wanted to stop them running. I ran $ ps aux | grep php $ sudo kill 8754 $ sudo kill 8767 And then ran $ ps aux | grep php again to ...
Jon's user avatar
  • 365
12 votes
2 answers
26k views

Convert file to PDF using LibreOffice under user apache (i.e. when using PHP)

I installed libreoffice-headless and can convert documents when logged on into the shell as a normal user. [root@desktop ~]# yum install libreoffice-headless [root@desktop ~]# yum install libreoffice-...
user1032531's user avatar
  • 1,651
12 votes
4 answers
7k views

How "legal" is site-scraping using cURL? [closed]

Recently I was experimenting with the cURL, and I found lot is possible with it. I built a small script that crawls a musical site, which plays online songs. On the way of my experiment, I found that ...
Chetan Sharma's user avatar
12 votes
3 answers
51k views

how to change path of php ini windows

I've downloaded php, addeded it to my path and im trying to enabled openssl php --ini tells me that configuration file is c:\windows which there was nothing there, I dont want to copy php into c/...
Guest's user avatar
  • 121
11 votes
3 answers
16k views

make a certain software version the default in ubuntu

I currently have 2 version of php installed on ubuntu 12.04. one for php 5.3 installed using apt-get while the other one is installed with xampp with php 5.5 When i execute these commands: > ...
chanHXC's user avatar
  • 211
11 votes
7 answers
111k views

WAMP MySQL Service will not start

I did a fresh install of WAMP (v2.1) and it works excep the MySQL isn't starting.... here: and everytime I press "Start/Resume Service", NOTHING happens. I go to my.ini and put in a password.Then go ...
test's user avatar
  • 460
11 votes
5 answers
61k views

How to rename multiple files in multiple folders with one command

We want to rename our *.html files to *.php but (sadly enough) have not enough knowledge to do it with a cmd prompt command and/or batch file. The problem is that each file is in separate folder – ...
Charles's user avatar
  • 263
11 votes
3 answers
14k views

Changing HTTP_ACCEPT_LANGUAGE

Is it possible to change HTTP_ACCEPT_LANGUAGE? I'm using Firefox.
user avatar
11 votes
6 answers
55k views

/usr/bin/env: php: No such file or directory

I want to use .sh script for deployment of my app. That script is on my home server (Ubuntu 15.10 Server), marked as executable. Access to this script is done through ssh, using this tutorial, I have ...
Tomáš Blatný's user avatar
10 votes
2 answers
84k views

How do I find and kill a php loop (process)?

I have a php script that I have been developing which calls an external api within a loop. It is being tested on a VPS which is running LAMP on Debian. I noticed this morning that the api was not ...
Hoytman's user avatar
  • 345
10 votes
2 answers
24k views

How to add PHP in netbeans on Ubuntu?

I just downloaded Netbeans for Ubuntu. Now I only have Java, how can I add PHP to it?
D.Vrancken's user avatar
10 votes
5 answers
4k views

What all is required for email from my server to pass through spam filters?

I have a serverbeach server with postfix installed. The hostname is something like p3204059.pubip.serverbeach.com The FQDN is specified as NONE for the server itself. I clicked change ptr record, ...
BreezyChick89's user avatar
10 votes
4 answers
50k views

Error message: sudo: mysql_secure_installation: command not found

I'm trying to learn PHP and I'm just in the process of installing apache,msql and PHP. I'm on a mac osx 10.7.2 I downloaded: mysql-5.5.18-osx10.6-x86_64.dmg I'm now at the point of setting the ...
Craig's user avatar
  • 111
10 votes
7 answers
13k views

Installing zeromq on Windows 7 WAMP server

I am looking for installing zeromq on my Windows 7 machine for using zeromq with PHP (I am using WAMP server (5.3.4), Apache Server 2.2.17). I followed the documentation on their site, but I don't ...
Thirumalai murugan's user avatar
10 votes
1 answer
1k views

Different background color for multiple filetypes in vim

Is it possible to have different background colors in vim (ie. one light, one dark) when dealing with files with multiple filetypes (ie. :set ft=html.php)? In PHP code with HTML embedded, it can be ...
puk's user avatar
  • 717
9 votes
4 answers
42k views

Running PHP works in Command Prompt but not Git Bash

I've recently got a new laptop and have been in the process of setting it up. I've installed WAMP, which is what I use to do my PHP development (installs Apache2, MySql, and PHP). I also like to use ...
James's user avatar
  • 193
9 votes
1 answer
7k views

How is Apache mapping files without extensions?

My local dev setup is mapping things like http://mydomain.dev/testhtmlpage to testhtmlpage.html and http://mydomain.dev/testphppage to testphppage.php. The browser stays on the orginally enter URL. ...
Denis Hoctor's user avatar
9 votes
2 answers
73k views

Perrmission to run specific command by sudo as www-data users without password

I have a webserver that also plays internet radio. As www-data user I want to run some commands, for example I've made this in /etc/sudoers file: www-data ALL=(ALL) NOPASSWD: /usr/bin/amixer ...
user avatar
8 votes
9 answers
264 views

Is it dangerous if I store a copy of an infected website on my local disk?

First, I'm not into HTML and PHP programming. A friend's Joomla site was hacked by some sort of html injection, and now every php and html file has an iframe which is linked to some sort of malware ...
user avatar
8 votes
4 answers
12k views

Error trying to install PHPUnit from PEAR

$ sudo pear install phpunit/PHPUnit Unknown remote channel: pear.symfony-project.com phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) phpunit/PHPUnit ...
Andrew's user avatar
  • 14.9k

1
2 3 4 5
40