Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

32
votes
8answers
22k 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?
14
votes
4answers
41k 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 ...
0
votes
1answer
3k views

Error 0x80240017 While Installing Microsoft Visual C++ 2015 Redistributable on Windows Server 2012 R2

I need to setup DUO Access Gateway for two factor authentication. Official documentation is given here. Which needs php-7.0.14-nts-Win32-VC14-x64 to run. I've also installed Windows 10 Universal C ...
4
votes
1answer
98 views

Linux: Interpreted-on-read (ala php) for local files

So the specific problem is that I want a file on my system to link to a http url, but fallback to a local version if there's no connection. The catch is that the program reading this file will be ...
2
votes
1answer
2k views

Apache is slower on other computers on local area network than on localhost

I have few computers connected into network. There's a server inside that network which hosts WAMP (Windows + Apache + PHP + MySQL). There is Windows 7 x32 Pro installed on it. I can ping that server ...
42
votes
3answers
69k 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 ...
60
votes
6answers
85k 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 ...
25
votes
2answers
26k 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 ...
11
votes
5answers
41k 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 – ...
1
vote
4answers
966 views

Some websites prompt to download PHP script after some time, but only in Firefox

This happens only in Firefox - NOT in IE or in Safari (all 3 tested only on a Windows system). Always, viewing a page shows most of the content, and then the browser prompts to download some sidebar ...
6
votes
7answers
1k views

Mac Text Editor (with function list) [duplicate]

Possible Duplicate: Text editor for Mac OS X So I've got a Mac in the post coming to me, and will probably be doing quite a bit of development on it so I am looking for a text editor (PHP + HTML ...
1
vote
1answer
3k views

PHP files are downloaded instead of getting interpreted

I'm encountring some difficulties with my Apache2/PHP5. All was well-configured and working, but after reinstalling apache2, the PHP files are displayed without being interpreted. I tried many ...
1
vote
3answers
2k views

charset=iso-8859-2 webpage displays with UTF-8 header - question marks (�) instead of accented letters

I have a webserver administration question. In this website: http://www.mirkaphoto.hu/ All PHP generated pages contain the following line: <meta http-equiv="Content-Type" content="text/html; ...
0
votes
3answers
3k views

Settings to send an email from localhost for PHP code in Windows Vista

I am using PHP 5 and Apache to do programming. My code can correctly send emails on the server, but on my own development machine I cannot send emails. There is clearly nothing wrong with my code, so ...
0
votes
4answers
15k views

WAMP Server's Apache Service Not Starting in Windows 8

I have a problem starting the Apache Service in WAMP Server, when i test port 80, I get the following message on the console Your port 80 is actually used by : Server: Microsoft -HTTPAPI/2.0 Things ...
42
votes
2answers
133k 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 ?
101
votes
4answers
438k 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?
12
votes
4answers
7k 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 ...
14
votes
5answers
58k 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 ...
18
votes
5answers
7k 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 ...
9
votes
2answers
18k 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-...
14
votes
1answer
49k 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’...
4
votes
5answers
11k views

Apache showing PHP code - after upgrade on Mac to macOS Sierra

I'm using an iMac which I've just updated to macOS Sierra. Prior to this it was running El Capitan. Under my El Capitan set up I had Apache, PHP and MySQL configured as per this guide. This worked ...
3
votes
1answer
2k views

Markdown “single page” PHP web application with live preview? [closed]

I would like to know if there is a PHP web application, such that When called with something like http://example.com/index.php?inputfile=mymarkdownfile.txt; it will open the file mymarkdownfile.txt ...
10
votes
1answer
939 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 ...
4
votes
6answers
51k 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 ...
3
votes
1answer
18k views

php is not recognized as an internal or external command (windows 7)

I added php to the PATH environment var. Showing here my last three entries in the path input: C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseGit\bin;C:\xampp\php\ Somehow when I run php -...
1
vote
3answers
360 views

Web Hosting at home on Old Hardware [closed]

This is a re-make of this interesting question. I've rephrased it slightly to avoid pulling aggro and to provide some quality information, as I've pondered this before, but only JUST ran the numbers.. ...
1
vote
2answers
629 views

am using ubuntu 12.10. unable to use PHP_PERL extension. Unable to install the extension as well

I need to run a Perl script because I need a module that Perl has that PHP does not. This is my code for testing purposes in PHP <?php echo ("Hello World"); $perl = new Perl(); $perl->...
0
votes
1answer
547 views

Wordpress can't upload images due to permissions [closed]

I'm having problems trying to get Media uploads working on my VPS w/ Wordpress. My Apache service is running as user:group apache:apache. My user folder is owned by my user eugene and grouped apache. ...
9
votes
3answers
10k views

Changing HTTP_ACCEPT_LANGUAGE

Is it possible to change HTTP_ACCEPT_LANGUAGE? I'm using Firefox.
5
votes
2answers
14k views

apache 2.4 + php 5.4.7 cannot load php5apache2_4.dll

I am trying to make Apache (httpd-2.4.3-win32) to work with PHP 5.4.7 (VC9 x86 Thread Safe) on Windows 7. Apaches default page is working and proudly says: "It works". PHP CLI is working and ...
4
votes
4answers
24k views

Copy entire website including PHP and SQL?

Is it possible when copying an entire website and template using wget (httrack or other program) to also get the PHP code and the SQL database? What software would I need to copy/mirror a site like ...
3
votes
2answers
1k views

PHP/cURL/Fedora issues resolving hostname possibly a DNS problem?

I have the following simple test script for cURL/php on a FC12/apache server that has PHP 5.3.2, cURL v7.19.7 (according to phpinfo()): $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www....
3
votes
3answers
14k views

PHP code is returned instead of executed

I have L-Ubuntu 11.04. I've installed Apache2 and I'm trying to simulate a server on my local file system by navigating to localhost in the browser. The problem is that I can't seem to get php to ...
2
votes
1answer
3k views

Microsoft PHP SQL Server Drivers not working, cant load module

I am trying to install Drivers for PHP to be able to talk to my SQL Server. I am running PHP 5.5.15 on XAMPP, and SQL Server 2014. I downloaded a driver package from here: http://www.microsoft.com/en-...
2
votes
3answers
15k views

Autocompletion for custom PHP classes in Sublime Text 2/3

How can I get autocomplete in Sublime Text 2 (or 3) to work with built-in and custom PHP functions, methods and classes? In Atom I've got it working with built-in functions, like this: In Sublime it ...
2
votes
2answers
993 views

Create a local DNS TLD for development

I do a lot of web dev, mainly RoR and PHP, I've got a VMs which holds my dev environments and handling multiple clients on them is a pain. With PHP you just create a subdir, but with RoR it's a little ...
2
votes
1answer
2k views

How to enhance Notepad++ to support Laravel blade syntax highlighting in a PHP file?

After looking online I cannot find any info on enhancing N++ to support syntax highlighting for Laravel's Blade syntax (*.blade.php). Example: demo.blade.php <html> <head> &...
2
votes
1answer
377 views

php sessions - is it possible to trigger a server script executed by a DIFFERENT user than www-data?

i am running a php+mysql site on a lamp ubuntu cloud server (amazon ec2). i use php sessions. the apache php user is called www-data. for every session (SID), i need to create a temporary folder ...
1
vote
0answers
182 views

Unable to use dashes in referential filenames, Why?

I recently setup Windows Subsystem Linux and created a symbolic link to a Windows folder in the Apache2 default server folder like so... ln -s /mnt/c/Users/user/Desktop/folder /var/www/html ...so ...
1
vote
3answers
2k views

How do I run PHP scripts via CMD without typing “php”?

If I have a batch file called "program.bat"... and I'm on the command line... I can just type program to get the program to run. If I'm on the command line, how do I get program.php to run ...
1
vote
1answer
6k views

How to switch PHP 5.5 instead PHP 5.4 in Bitnami

Details: Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS Release: 12.04 Codename: precise Bitnami used in AWS I want to install PHP 5.5, so I do next step: php -v PHP 5.4.26 (...
1
vote
2answers
2k views

PHP not working on fresh install

Ok so i just installed apache2 and php5 following along with this tutorial http://www.socialblogr.com/2010/08/how-to-install-php-monggodb-monggo-driver-on-linux-ubuntu.html But php isn't working, ...
1
vote
3answers
3k views

PHP can't connect to PostgreSQL with “permission denied” error with SELinux

My PHP app can connect when I turn off SELinux, but not with it on. setenforce 0; curl -I http://domain.com; setenforce 1 Yields no errors in /var/log/httpd/error_log. However, if I have it on, I ...
1
vote
4answers
925 views

PHP for Mac OS X

I want to use PHP on my Mac. If I were using Windows I would install WAMP server, but I'm not familiar with how to use PHP on Mac OS X. What kind of software should I use for installing/running my ...
1
vote
1answer
73 views

Cannot upload files larger than 1GB in PHP under Apache even with 'post_max_size' and 'upload_max_filesize' set to 4096M

As I understand, when hosting a webserver with Apache and PGP, the three settings within php.ini that determine the maximum upload size are: memory_limit post_max_size upload_max_filesize As I have ...
1
vote
3answers
3k views

Vim: How to indent html code correctly in php file?

In php file : <?php ... ?> <html> </html> I could not indent the html source code with operator =. How could I indent it?
0
votes
0answers
201 views

mod_rewrite working but php pages not found or not recognized (downloaded instead of executed)

In regard to my first post mod_rewrite problems in sandbox: Mac OSX 10.6.6 Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8l DAV/2 PHP/5.3.3 I am making progress but... Now the index.php page is not ...
0
votes
0answers
418 views

Using DOMDocument + DOMXPath to remove all but specific tags and attributes from HTML

I have arbitrary body HTML and need to process it in PHP to remove all tags except a few "well known" ones (<h1><h2><h3><h4><ul><ol><li><p><br><a><b><u><i><...