This is probably a very tired question...
I have a macbook, new (leopard 10.5.2) with an already installed php 5.25 (I found this by hitting the terminal with php -v
I can't find the php.ini file, nor can i even find a file dedicated to php in my library, though i have ruby, perl and python there.
anyways
I've created a test.php file and saved it in my root directory. i hit my browser with http://localhost/~mike
and receive a return of the test.php file. in that file i included the script <?php phpinfo(); ?> but when i click the file the page just diplays that script, not all the info it's supposed too.
I need to find this php.ini file
help
php.ini (newbie)
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: php.ini (newbie)
Create a file, and add
This should contain the path to your php.ini in the "Loaded Configuration File" value, I believe. Don't forget to delete this file afterwards, so it's not publicly available.
Code: Select all
<?php
phpinfo();
?>-
mikevarela
- Forum Newbie
- Posts: 3
- Joined: Sat Apr 12, 2008 3:23 pm
Re: php.ini (newbie)
Thanks for the reply, though as stated in the previous post, i've already created that file with that script, and when i serve it via http://localhost/~mike i get a white page showing the script, but not all the pertinent info i need.
it just shows <? phpinfo(); ?>
can you help me find the php.ini page
it just shows <? phpinfo(); ?>
can you help me find the php.ini page
- EverLearning
- Forum Contributor
- Posts: 282
- Joined: Sat Feb 23, 2008 3:49 am
- Location: Niš, Serbia
Re: php.ini (newbie)
It shows <? phpinfo(); ?> because you're using short tags for php - <?(which are in PHP5 turned off by default), instead of <?php
Copy arborint's code, it will show filepath to your the php.ini
Copy arborint's code, it will show filepath to your the php.ini
-
mikevarela
- Forum Newbie
- Posts: 3
- Joined: Sat Apr 12, 2008 3:23 pm
Re: php.ini (newbie)
I must be completely retarded. I copied the code and the same result came out.
The page just repeats what i enter in the test.php page.
I've tried it like this <?php phpinfo(); ?> - and - like this <? phpinfo(); ?>
both return the same thing.
am i correct in creating a php page in textmate by just entering this code (the first one) and saving it as test.php in the sites folder on my mac?
and what are short tags?
The page just repeats what i enter in the test.php page.
I've tried it like this <?php phpinfo(); ?> - and - like this <? phpinfo(); ?>
both return the same thing.
am i correct in creating a php page in textmate by just entering this code (the first one) and saving it as test.php in the sites folder on my mac?
and what are short tags?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: php.ini (newbie)
Oops, sorry! I sometimes tend to skip posts.EverLearning wrote:Thanks for the reply, though as stated in the previous post, i've already created that file with that script, and when i serve it via http://localhost/~mike i get a white page showing the script, but not all the pertinent info i need.
Ahem.EverLearning wrote:Copy arborint's code, it will show filepath to your the php.ini
It sounds like you haven't added the .php file extension to be parsed by the php interpreter. I have no idea what the Mac filesystems look like, but look around for apache's httpd.conf file, and see if you can findmikevarela wrote:I must be completely retarded. I copied the code and the same result came out.
The page just repeats what i enter in the test.php page.
I've tried it like this <?php phpinfo(); ?> - and - like this <? phpinfo(); ?>
both return the same thing.
am i correct in creating a php page in textmate by just entering this code (the first one) and saving it as test.php in the sites folder on my mac?
Code: Select all
AddType application/x-httpd-php .phpShort tags are a short version of the standard php tags <?php ?>... the short version being <? ?>. It is highly recommended you never use short tags since they can easily be disabled in any environment, which makes portability a issue.mikevarela wrote:and what are short tags?