install wordpress locally on OS X without MAMP (permission error) - macos

I'm trying to install wordpress locally on a mac with the built in stuff (apache/php) without installing MAMP. basically I'm following this tutorial:
https://gist.github.com/1500117
after editing the httpd.conf file, and restarting apache, I get this error in the browser:
Forbidden
You don't have permission to access / on this server.
Any ideas?
I'm using Snow Leopard

well it seams I found what caused the problem.
the Sites folder, where I put the wordpress folder had permissions 750, after changing it to 751, now it works.
is this a proper solution or I should keep digging?

While there are a lot of variables to check here, the two biggest are the server root (make sure the case of all the path elements is correct) and the user permissions/owner of the WordPress files themselves.
All that said, why not use MAMP for this kind of situation?

Try typing http://your-host-name/index.php
If that fixes it, then your DirectoryIndex directive (in httpd.conf) needs to be changed to DirectoryIndex index.html index.php
If that does not fix it, type tail -f /var/log/apache2/error_log at the console and look at the terminal screen while you hit http://your-host-name/index.php in your browser. It may tell you what the problem is. If not, paste the last few lines of the log file up here and I'll look at it for you.

Related

Change localhost/htdocs folder in Xampp 8.2

I know this is not a new question but I think something has changed with Xampp in the latest version. I was using Xampp 8.0 and was using another directory to serve as localhost just fine. My Xampp installation is in C:/xampp while my projects are located in D:\Whip\Projects. This is the folder I want to load when using the address localhost.
I changed 2 lines in httpd.conf like I had done several times before
DocumentRoot "D:\Whip\Projects"
<Directory "D:\Whip\Projects">
The folder loads but PHP doesn't work properly. I get errors related to missing session folders and extensions. The problem is in php.ini file the paths are not absolute anymore. For example, in xampp 8.0 I had
session.save_path="C:\xampp\tmp"
In 8.2 I have
session.save_path="\xampp\tmp"
And same thing with extensions directory and all other paths defined in php.ini (and who knows where else). If I manually add C: to the path above, the sessions start working. I'm apprehensive of changing every path like that. Is there a better way to change the htdocs folder now?

got 500 Internal Server error in joomla [duplicate]

I have installed new site in Joomla 1.7 and its working fine, but when i checked its back-end (administrator) got 500 Internal Server Error.
Note: Site is working fine in Local server.
Please suggestion me any solution.
Thanks in advance.
First you have change folder permission to 775 for the following folders:
cache, logs, tmp & administrator/cache
then go to: configuration.php
find code:
$log_path = 'XXXXXXXXXXXXX';
$tmp_path = 'XXXXXXXXXXXXX';
and change code into:
$log_path = './logs';
$tmp_path = './tmp';
problem solved :)
I had this problem, but none of your advices didn't help.
I fixed a problem only after I switched off all modules via PhpMyAdmin (PMA).
Table modules, changed parameter "published" to 0 for all and then enabled only few modules with these types:
mod_login
mod_menu
mod_sumbenu
mod_toolbar
mod_title
After this I entered admin page and used top menu to enable all needed modules one by one. After admin page started to give me 500 error again I knew what module is faulty and I disabled it again via PMA.
May be some files are not uploded.Check failed transfer of your FTP server.Make sure all the files are uploded online
Check your error logs and backtrace what is causing the error. It sounds like you have MySQL errors, make sure any of your components/modules/aren't tricking out your site.
Think it's a component?
You can login into PHPMyAdmin and disable/enable modules manually by unpublishing them using the table editor, changing isPublished to 0 .
Try reinstalling database with the correct compatibility and also check web.config file on ftp for correct configuration paths !
I experienced something similar on my site. Digging through the log file, /administrator/error_log i saw this error message:
[08-Oct-2012 15:28:59] PHP Fatal error: Call to a member function login() on a non-object in /home/XXX/public_html/administrator/components/com_login/admin.login.php on line 65 .
Problem was, i had a previous installation of Joomla 1.5.x, and uploaded files for Joomla 1.6 to replace the previous files and upgrade security of the site. Took me almost a month to find a solution for my own case;
Finally found out from this website that I needed to completely delete all previous files in the website root directory before uploading a new version of Joomla.
Hope this helps someone out there who is in the same situation!
I also have the same issue on my site backend when editing or saving some articles, modules etc...Finally i solved it...
Add these lines to /etc/httpd/conf.d/mod_secuirity.conf on your server
SecRuleEngine Off
save it...and restart apache...it works fine for me.
Adding these lines disable mod_secuirity engine off.I don't know if it causes secuirity problems in future..
Tnx all...
Change the permission of folder administrator at 775 or 755
I tried all the above ideas. Without avail. For my site (which was an outdated Joomla 1.5.x site- don't ask!!!), where the backend suddenly stopped working, the final solution was switching the servers PHP version from 4 to 5.5 (even 5.4 did not work!).
I then got some strange PHP warnings in the frontend. But I then updated Joomla from the now again working backend to the last 1.5 version and everything worked fine from the on.
Phew! Maybe this helps someone later on...
In my case there was a single file with bad permissions.
It can be tricky to figure out which file has the problem so just run this to set the permissions for all the files in the directory:
chmod -R ug+rwX .
chmod -R o+rX .
Change the permissions of all of your files/directories.
Files should be 755
Directories should be 644
This is my case and my solution:
I have changed my server and got this error. I have protected my administrator folder using password protection method. So I have checked my new server and found that my protection information are not saved in control panel. also my .htaccess file (in administrator folder) is not compatible to my new server.
The solution:
Simply protect my folder using control panel
I have renamed the .htaccess file to htaccess.txt
It is done.
I hope it could be useful ;)

Where does MAMP keep its php.ini?

I have recently got a mac an am not used to developing on a mac at all.
I have MAMP Pro 1.9.6.1. I did a locate on php.ini and got this:
$ locate php.ini
/Applications/MAMP/conf/php5.2/php.ini
/Applications/MAMP/conf/php5.3/php.ini
/Library/Application Support/appsolute/MAMP PRO/conf/php.ini
/private/etc/php.ini.default
I changed the name of all of them. Restarted MAMP. It loaded without a hitch (I know odd right?). I am using PHP version 5.2.
All of these files are now different names (done one by one for process of elimination).
So I figure restart the mac. Same, MAMP loaded no problems, even though all of the php.ini files had been move. On Lamp this that wouldn't even load. But either there is another php.ini file I'm missing (quite possible I don't know how to updatedb), MAMP is really intelligent and just pulls in all of them (less likely) or it doesn't use one.
Note: If this doesn't help, check below for Ricardo Martins' answer.
Create a PHP script with <?php phpinfo() ?> in it, run that from your browser, and look for the value Loaded Configuration File. This tells you which php.ini file PHP is using in the context of the web server.
I'm not sure if in MAMP (non-PRO) is the same, but MAMP overrides the modified php.ini everytime it starts.
In my case, I needed to use the MAMP menu to change my php.ini file (File -> Edit Template -> PHP -> PHP 5.xx -> php.ini).
To be clearer (as i read this thread but didn't SEE the solution, also if it was here!), I have the same problem and found the cause: I were modifying the wrong php.ini!
Yes, there are 2 php.ini files in MAMP:
Applications/MAMP/conf/php5.5.10/php.ini
Applications/MAMP/bin/php/php5.5.10/conf/php.ini
The right php.ini file is the second: Applications/MAMP/bin/php/php5.5.10/conf/php.ini
To prove this, create a .php file (call it as you like, for example "info.php") and put into it a simple phpinfo()
<?php
echo phpinfo();
Open it in your browser and search for "Loaded Configuration File": mine is "/Applications/MAMP/bin/php/php5.5.10/conf/php.ini"
The error was here; i edited Applications/MAMP/conf/php5.5.10/php.ini but this is the wrong file to modify! Infact, the right php.ini file is the one in the bin directory.
Take care of this so small difference that caused me literally 1 and a half hours of headaches!
The file you have to edit is in MAMP Pro and uses the php.ini file everytime it starts up.
Start MAMP PRO
Edit File > Edit Templates > PHP 5.3.2 php.ini
Restart MAMP Pro
Your changes should stick.
I don't know if you ever found an answer to this but I DIDN'T need MAMP PRO to do this. Simply goto the correct path by following what others have said. It's something like...
MAMP-> bin-> php-> php(your php version)-> conf-> php.ini
The key here is where you're editing the file. I was making the mistake of editing the commented part of the ini file. You actually have to scroll down to LINE #472 where it says "display_errors = Off and change it to On. Hope this helps any
Just run the following command from your terminal, it will show you your Loaded Configuration File easiest way I have ever found.
php --ini
Change /Applications/MAMP/conf/php5.2/php.ini if you are using 5.2 version of php. If you are using the 5.3 php version, edit the /Applications/MAMP/conf/php5.3/php.ini.
If you are using OSX Lion or OSX Mountain Lion, I recommend you using the default installation of apache and php.
Greets!
After running the MAMP server, you have php info link in toolbar
Once click, You will get all information about php
Probably the fastest way to access the PHP.ini for the currently loaded version of PHP in MAMP PRO (v.4.2.1):
Open MAMP Pro
Click on "PHP" under the "Languages" section on the sidebar
Tap on the arrow button right next to the drop-down that lets you select the "Default Version" of PHP.
It depends on which version of PHP your MAMP is using. You can find it out on: /Applications/MAMP/conf/apache/httpd.conf looking for the configured php5_module.
After that, as someone said before, you have to go to the bin folder. There you'll find a conf folder with a php.ini inside.
example: /Applications/MAMP/bin/php/php5.4.10/conf
Leo
After going through all the solutions here, the easiest way to find the loaded php.ini file is to go into phpinfo on the loaded MAMP webpage, which will show you the loaded php.ini file.
This will also confirm if the parameters you change, like max_file_size, have updated correctly.
On my Mac, running MAMP I have a few locations that would be the likely php.ini, so I edited the memory_limit to different values in the 2 suspected files, to test which one effected the actual MAMP PHP INFO page details.
By doing that I was able to determine that this was the correct php.ini:
/Applications/MAMP/bin/php/php7.2.10/conf/php.ini
I only have the non-pro version of MAMP but just because it loads it doesn't mean the PHP file is being found/without errors.
I renamed my php.ini files and MAMP still started but Apache returned several errors.
What are you trying to change in your php.ini file?
I have checked all answers and of course I have used phpinfo() to check the exact location of php.ini. I don't see a File option in the menu bar on my mac. I changed both php.ini and php.ini.temp files in that folder. No vail.
Until I realized that I forgot to uncomment the modified always_populate_raw_post_data line.
I was struggling with this too. My changes weren't being reflected in phpInfo. It wasn't until I stopped my servers and then restarted them again that my changes actually took effect.

500 internal server error at back end - Joomla

I have installed new site in Joomla 1.7 and its working fine, but when i checked its back-end (administrator) got 500 Internal Server Error.
Note: Site is working fine in Local server.
Please suggestion me any solution.
Thanks in advance.
First you have change folder permission to 775 for the following folders:
cache, logs, tmp & administrator/cache
then go to: configuration.php
find code:
$log_path = 'XXXXXXXXXXXXX';
$tmp_path = 'XXXXXXXXXXXXX';
and change code into:
$log_path = './logs';
$tmp_path = './tmp';
problem solved :)
I had this problem, but none of your advices didn't help.
I fixed a problem only after I switched off all modules via PhpMyAdmin (PMA).
Table modules, changed parameter "published" to 0 for all and then enabled only few modules with these types:
mod_login
mod_menu
mod_sumbenu
mod_toolbar
mod_title
After this I entered admin page and used top menu to enable all needed modules one by one. After admin page started to give me 500 error again I knew what module is faulty and I disabled it again via PMA.
May be some files are not uploded.Check failed transfer of your FTP server.Make sure all the files are uploded online
Check your error logs and backtrace what is causing the error. It sounds like you have MySQL errors, make sure any of your components/modules/aren't tricking out your site.
Think it's a component?
You can login into PHPMyAdmin and disable/enable modules manually by unpublishing them using the table editor, changing isPublished to 0 .
Try reinstalling database with the correct compatibility and also check web.config file on ftp for correct configuration paths !
I experienced something similar on my site. Digging through the log file, /administrator/error_log i saw this error message:
[08-Oct-2012 15:28:59] PHP Fatal error: Call to a member function login() on a non-object in /home/XXX/public_html/administrator/components/com_login/admin.login.php on line 65 .
Problem was, i had a previous installation of Joomla 1.5.x, and uploaded files for Joomla 1.6 to replace the previous files and upgrade security of the site. Took me almost a month to find a solution for my own case;
Finally found out from this website that I needed to completely delete all previous files in the website root directory before uploading a new version of Joomla.
Hope this helps someone out there who is in the same situation!
I also have the same issue on my site backend when editing or saving some articles, modules etc...Finally i solved it...
Add these lines to /etc/httpd/conf.d/mod_secuirity.conf on your server
SecRuleEngine Off
save it...and restart apache...it works fine for me.
Adding these lines disable mod_secuirity engine off.I don't know if it causes secuirity problems in future..
Tnx all...
Change the permission of folder administrator at 775 or 755
I tried all the above ideas. Without avail. For my site (which was an outdated Joomla 1.5.x site- don't ask!!!), where the backend suddenly stopped working, the final solution was switching the servers PHP version from 4 to 5.5 (even 5.4 did not work!).
I then got some strange PHP warnings in the frontend. But I then updated Joomla from the now again working backend to the last 1.5 version and everything worked fine from the on.
Phew! Maybe this helps someone later on...
In my case there was a single file with bad permissions.
It can be tricky to figure out which file has the problem so just run this to set the permissions for all the files in the directory:
chmod -R ug+rwX .
chmod -R o+rX .
Change the permissions of all of your files/directories.
Files should be 755
Directories should be 644
This is my case and my solution:
I have changed my server and got this error. I have protected my administrator folder using password protection method. So I have checked my new server and found that my protection information are not saved in control panel. also my .htaccess file (in administrator folder) is not compatible to my new server.
The solution:
Simply protect my folder using control panel
I have renamed the .htaccess file to htaccess.txt
It is done.
I hope it could be useful ;)

Where do I put my php files to have Xampp parse them?

I finished installing Ubuntu 10 for netbooks, and XAMPP. The XAMPP website tutorial made it very easy to install, then left me high and dry. Everything works, but I have no idea where to put my handwritten php files.
After a few hours of googling, and trying to understand the file explorer, I realized I have no idea where anything is in ubuntu. For an answer, please don't just tell me "go to "X" directory. I won't know how to navigate there.
I also did a file search for htdocs with no luck.
in XAMPP the default root is "htdocs" inside the XAMPP folder, if you followed the instructions on the xampp homepage it would be "/opt/lampp/htdocs"
I created my project folder 'phpproj' in
...\xampp\htdocs
ex:...\xampp\htdocs\phpproj
and it worked for me. I am using Win 7 & and using xampp-win32-1.8.1
I added a php file with the following code
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
was able to access the file using the following URL
http://localhost/phpproj/copy.php
Make sure you restart your Apache server using the control panel before accessing it using the above URL
When in a window, go to GO ---> ENTER LOCATION...
And then copy paste this: /opt/lampp/htdocs
Now you are at the htdocs folder.
Then you can add your files there, or in a new folder inside this one (for example "myproyects" folder and inside it your files... and then from a navigator you access it by writting:
localhost/myproyects/nameofthefile.php
What I did to find it easily everytime, was right click on "myproyects" folder and "Make link..."... then I moved this link I created to the Desktop and then I didn't have to go anymore to the htdocs, but just enter the folder I created in my Desktop.
Hope it helps!!
Look into the httpd.conf and/or httpd-vhosts.conf files and search for the DocumentRoot entry. If you configure multiple virtual hosts, there may be more than one of those, separated in <VirtualHost> tags.
This will work for me:
.../xampp/htdocs/php/test.phtml
The default location to put all the web projects in ubuntu with LAMPP is :
/var/www/
You may make symbolic link to public_html directory from this directory.Refered. Hope this is helpful.

Resources