trying to install/use php on a mac [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I'm trying to set up php on my mac. From what I gathered, mac already comes preinstalled with php so I went through the whole httpd.conf and editing LoadModule php5_module libexec/apache2/libphp5.so to uncomment it.
I can't find a clear instruction on what to do after that. PHP seems to be still not running when I open a test file in my browser. Some sites say to add a IfModule php5_module block? but others don't mention that.

Well I click file>open in chrome
You are ignoring your web server and loading the file directly from your file system.
This means that Apache will not see the file, so it will not pass it through the PHP engine.
You must load the file over HTTP from your web server. Type http://localhost/etc/etc into the address bar (where /etc/etc is the path to your file from the DocumentRoot).

I use MAMP on a mac to do testing with serverside code - http://www.mamp.info/en/mamp-pro/

Related

VIM caught deadly signal SEGV when opening PHP file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have PHP file on my virtual Linux CentOS machine and intermittently when I open it I am getting right away
Vim: Caught deadly signal SEGV
Vim: Finished. Segmentation fault.
I tested that file many times there are no any kind of hidden special characters. More over if I open another PHP file or for that matter any file and open my troubled file from it (:e file_name) I can view it, edit and save without any problems.
Any suggestions what is wrong with that file and how to fix it?
Try following command:
vim -u NONE <your_file>
it will launch vim without processing /etc/vimrc and ~/.vimrc
If you'll be able to edit your file then it means that the problem is one of your vim plugins. Try disabling them one by one and see what happens.

Source code appears with apache, why repare? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I own a site installed on my linux server but when I put PHP tags at the beginning of page, the source code appears..
How to avoid all the source code displayed ?
thank you in advance
This means that you are being served the file by Apache without it first being seen (processed) by PHP. Here are some troubleshooting tips as to why it isn't being processed by PHP:
Make sure that your file with the PHP tags ends in .php.
Make sure PHP is installed on your server. To install PHP on a debian server run sudo apt-get install php5

Loading php extension for specific domain only [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a dedicated LAMP server with more than one domains hosted. I want to load a php extension only for a single domain. Is it possible?
Edit your VirtualHost configuration.
Make a copy of php.ini file. Add the extension you need in there. Store it in separate directory.
Use PHPIniDir in your config for the particular site and point to that new dir, containing new php.ini
Restart apache.
Your config will be loaded and will use separate php.ini file.

Curious as to why system said it was loading php.ini file from different directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I was wondering why my system says it is running the php from the /etc/php5/apache2/php.ini
directory when in fact it was running it from the /etc/php5/cli/php.ini .
When I did a phpinfo() on a file in the directory of the folder, I received this however the changes to the configuration file wasn't impacting the server until I searched the whole system for a php.ini file and found the php.ini file under the cli/ directory:
Hopefully you can see it. I wasn't sure exactly how to put in onto SO.
it's intentional so you can easily have different configuration depending on your runtime environment.
In your environment when php runs in command line mode it uses /etc/php5/cli/php.ini.
When you access it from browser php is running from apache. So then /etc/php5/apache2/php.ini is used.

Upgrading PHP to latest version [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I've been using PHP-5.4.3 for about a month now, and today, I decided to make a switch to PHP-5.5.5, I downloaded the source code, and placed it in C:/php (also renaming the folder php-5.5.5 to php) and I added server variables, as usual C:/php/ <-- but here I got stuck. Because, usually I appended the php.exe at the end, which was found inside the PHP folder so, I could be able to access PHP from the command line, or start the built-in server, but now,I can't find this file, and I can't find a way to start the server from the command line either.
You can compile php yourself. It's simply 2-4 commands and its also explained. I can run configure then make install. You can run configure --help to see all the options. It can be useful if you compile for fast-cgi or need more space or a faster php.
The source code you downloaded needs to be built...
You can download a binary version from here (assuming you're using Windows, of course).
Or read this if you want to build it yourself. There are many other tutorials online.

Categories